Open WJsjtu opened 2 years ago
https://github.com/windicss/vite-plugin-windicss/blob/a9a6ffa2b59d27ce5b06df41fe9babb68ddf8117/packages/plugin-utils/src/resolveOptions.ts#L112-L116 这里直接拼root的方法对于想要exclude pnpm安装的node_modules会有问题:webpack插件context的resourcePath都是原始路径不是链接路径,所以scanOptions.exclude中的node_modules全部都不会按照预期的生效,它依旧会处理一些第三方库,比如../../node_modules/.pnpm/@arco-design+web-react@2.34.0_toktsx4rp6zr3oxhhtw5ts6lt4/node_modules/@arco-design/web-react/es/Menu/style/index.less这样的文件(../../对应的其实是我最外层主项目的packages/whatever-package-name),然后触发一个解析错误
../../node_modules/.pnpm/@arco-design+web-react@2.34.0_toktsx4rp6zr3oxhhtw5ts6lt4/node_modules/@arco-design/web-react/es/Menu/style/index.less
https://github.com/windicss/vite-plugin-windicss/blob/a9a6ffa2b59d27ce5b06df41fe9babb68ddf8117/packages/plugin-utils/src/resolveOptions.ts#L112-L116 这里直接拼root的方法对于想要exclude pnpm安装的node_modules会有问题:webpack插件context的resourcePath都是原始路径不是链接路径,所以scanOptions.exclude中的node_modules全部都不会按照预期的生效,它依旧会处理一些第三方库,比如
../../node_modules/.pnpm/@arco-design+web-react@2.34.0_toktsx4rp6zr3oxhhtw5ts6lt4/node_modules/@arco-design/web-react/es/Menu/style/index.less
这样的文件(../../对应的其实是我最外层主项目的packages/whatever-package-name),然后触发一个解析错误