vite-plugin-style-import
vite-plugin-style-import copied to clipboard
A plug-in that imports component library styles on demand.it is fast
```json "engines": { "node": ">=12.0.0" }, ``` 将在下一个版本发布时显示在 [README](./README.md) 的 `node version`
无法使用可选链
插件源码中使用了可选链,但是可选链的 node版本需要 14+,文档中是兼容到node 12+,文档需要更新下: ``` configResolved(resolvedConfig) { needSourcemap = !!resolvedConfig.build.sourcemap; external = resolvedConfig?.build?.rollupOptions.external ?? void 0; }, ```
![image](https://user-images.githubusercontent.com/15847900/168465390-0f6f3981-06cf-4fea-afc5-4e1b1a8755e2.png)
[NutuiResolve](https://github.com/vbenjs/vite-plugin-style-import/blob/main/packages/core/src/resolve/nutui.ts) 这个方法有点问题。它会导致在 Linux 环境下找不到对应的路径。因为 Nutui 的包实际都是小写的。所以我自己写了个 resolve。希望官方可以改进一下: ![image](https://user-images.githubusercontent.com/3530301/165879549-3747b6cd-9fdf-4214-ba8a-0aa2c54844bd.png)
Error in v2.0 fix the error that the 2.0 version prompts that consola cannot be found
新增功能 - 增加对arco-vue组件库的支持 [#65](https://github.com/vbenjs/vite-plugin-style-import/issues/65) @anncwb 辛苦cr。3q
我在使用2.0.0版本时,报出`consola`模块没有安装的错误,查看`packages/core/package.json`发现`consola`模块安装错误。
version:2.0.0 description:vben-admin 执行打包命令报错,降到1.x版本正常 ```bash failed to load config from C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\vite.config.js error during build: Error: Cannot find module 'consola' Require stack: - C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\node_modules\.pnpm\[email protected][email protected]\node_modules\vite-plugin-style-import\dist\index.cjs - C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\vite.config.js - C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\node_modules\.pnpm\[email protected][email protected]\node_modules\vite\dist\node\chunks\dep-f9d9421a.js - C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\node_modules\.pnpm\[email protected][email protected]\node_modules\vite\dist\node\cli.js - C:\workspace\lesntec\SCAN-ROBOT-SYSTEM\node_modules\.pnpm\[email protected][email protected]\node_modules\vite\bin\vite.js...
failed to load config from /Users/imax/WebstormProjects/atlas/vite.config.ts error when starting dev server: Error: Cannot find module 'consola' Require stack: - /Users/imax/WebstormProjects/atlas/node_modules/vite-plugin-style-import/dist/index.cjs - /Users/imax/WebstormProjects/atlas/vite.config.ts - /Users/imax/WebstormProjects/atlas/node_modules/vite/dist/node/chunks/dep-f5552faa.js - /Users/imax/WebstormProjects/atlas/node_modules/vite/dist/node/cli.js - /Users/imax/WebstormProjects/atlas/node_modules/vite/bin/vite.js at Function.Module._resolveFilename...