-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[RFC] 重新 Review 业务组件自动生成 style.js 以及项目中自动引入该文件的功能设计 #4705
Comments
imsobear
changed the title
业务组件自动引入 style.js 文件方案讨论
重新 Review 业务组件自动生成 style.js 以及项目中自动引入该文件的功能设计
Sep 26, 2021
业务组件脚手架变更:
sideEffects: [
"dist/*",
"*.scss",
"*.less"
"*.css"
]
import './index.scss' |
1 task
赞同去掉 style.js 项目引入基础组件样式,有两种方式:
style.js的存在让项目全量引入样式,这种用法,出现了多份重复内容引入(工程上路径不一样,wepback识别为不同文件,无法去重) |
webpack-plugin-import 建议发一个大版本:
关于对 webpack-plugin-import 的依赖:
|
已完成 |
ClarkXia
changed the title
重新 Review 业务组件自动生成 style.js 以及项目中自动引入该文件的功能设计
[RFC] 重新 Review 业务组件自动生成 style.js 以及项目中自动引入该文件的功能设计
Oct 27, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景
在业务组件工程设计初期,为了实现引入业务组件无需单独 import 对应样式,同时兼容不支持 js 里 import css 的老工程体系,因此设计了 style.js 方案:
ice/packages/plugin-react-app/src/setBase.js
Lines 58 to 72 in 30cae8e
问题
方案
src/index.jsx
里import './index.scss'
,并且在 package.json 里配置好对应的 sideEffects 字段,防止被 tree-shaking 掉The text was updated successfully, but these errors were encountered: