Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better compatibility for pnpm #296

Open
WJsjtu opened this issue May 29, 2022 · 0 comments
Open

Better compatibility for pnpm #296

WJsjtu opened this issue May 29, 2022 · 0 comments

Comments

@WJsjtu
Copy link

WJsjtu commented May 29, 2022

function resolveGlob(glob: string) {
if (glob.startsWith('!'))
return `!${slash(path.resolve(root, glob.slice(1)))}`
return slash(path.resolve(root, glob))
}
这里直接拼root的方法对于想要exclude pnpm安装的node_modules会有问题:webpack插件context的resourcePath都是原始路径不是链接路径,所以scanOptions.exclude中的node_modules全部都不会按照预期的生效,它依旧会处理一些第三方库,比如../../node_modules/.pnpm/@[email protected]_toktsx4rp6zr3oxhhtw5ts6lt4/node_modules/@arco-design/web-react/es/Menu/style/index.less这样的文件(../../对应的其实是我最外层主项目的packages/whatever-package-name),然后触发一个解析错误
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant