-
Notifications
You must be signed in to change notification settings - Fork 815
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
vite4使用auto-import-resolver按需引入任一组件报错 #2841
Labels
invalid
This doesn't seem right
Comments
|
建议提供能复现的依赖版本都正确的 demo |
1、这个插件的包名为 不同项目里的配置可能是天差地别的,yarn/npm/pnpm、js/ts、vite/vue/unplugin 版本不同都会影响,甚至可能是 tsconfig 或者 vite 的哪个配置项出了问题。提供可复现的环境能直接避开这些差异,更快的解决问题。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NutUI 包名
@nutui/nutui
NutUI 版本号
4.2.7
平台
h5
重现链接
https://codesandbox.io/s/nutui4-vite-demo-forked-8x7xdr?file=/vite.config.ts
重现步骤
<nut-button>按钮</nut-button>
;unplugin-vue-components/vite
和@nutui/auto-import-resolver
;importStyle: 'sass'
,sass按需引入也报错。期望的结果是什么?
任一组件正常引入,页面能正常显示
实际的结果是什么?
css方式引入报错:
sass方式引入也报错:
环境信息
System:
OS: macOS 14.2.1
CPU: (8) arm64 Apple M1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
Browsers:
Chrome: 120.0.6099.216
Safari: 17.2.1
npmPackages:
@nutui/nutui: ^4.2.7 => 4.2.7
windows和mac多台电脑,nodejs版本18都是同样的问题。
其他补充信息
其他信息:
解决方法:
直接修改本地的@nutui/auto-import-resolver/dist/index.js文件第11行后,sass按需引入成功,改动如下:
The text was updated successfully, but these errors were encountered: