-
Notifications
You must be signed in to change notification settings - Fork 10
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
如果想每次引入单个组件的时候不引入样式文件如何修改打包策略 #3
Comments
在项目中使用时,样式文件需要手动引入,不会自动引入。如果不想打包单个组件的样式,简单方法可以在 |
我的意思是打包后,每个组件的文件里面都有对应的样式文件了,而不是像现在这样 不需要再去手动全部引入一次总的样式文件,比如我只想用一个组件 就只用这一个组件的样式 不需要额外引入全部组件的样式 |
See: https://github.com/wangyewei/design-06k4/blob/Devlopment-Version/scripts/build-css.js |
我找到解决方式了,一种是自己写了rollup插件,跟你这个差不多,自己编译scss。另一种是把每个组件作为独立入口,这个一开始尝试过,问题是css还是全部打成一个,没有独立拆分。最后发现需要独立配置打包目录,因为css是和js打到同级的。 |
编写Rollup插件听起来不错,感兴趣的话欢迎提交pr! |
No description provided.
The text was updated successfully, but these errors were encountered: