Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #9406
What
使用 amis-editor 时,会重复引用 amis-ui/scss/_components.scss
第一份来自于 amis-ui/scss/themes/cxd.scss 引入的 components.scss
第二份来自于 amis-editor-core/scss/editor.scss 引入的 components.scss
Why
因为 amis-editor 依赖 amis-ui。amis-ui 会引用相应的主题样式。
如:
amis-ui/scss/themes/cxd.scss
因此第二份引入的样式是冗余的。
收益:
复现案例来自于 amis 仓库中的 examples。
复现路径:
npm start
,访问 localhost:8080/packages/amis-editor;查看 network开发环境:
优化前:
优化后:
生产环境:
amis-editor-core/lib/style.css 从 437kb 降低至 182 kb
How
删除 amis-editor-core 中的样式变量引用。