How to remove unused components
MichalW opened this issue · 2 comments
MichalW commented
Hi, I installed "semantic-ui-less" according to this guide:
https://react.semantic-ui.com/theming
Now, I have automatically included styles for all elements, modules, etc.
They are included even in the build.
In the previous version, I could turn them off in the file "semantic.json".
Is it currently possible to not include all components and reduce the final style file?
MichalW commented
My mistake - I looked at the wrong package.
The customization I'm looking for is here:
https://semantic-ui.com/introduction/getting-started.html
By the way, it would be great if this package could do it too
MichalW commented
I found a very easy way to remove unused styles using this package.
- Copy file
semantic.less
from/node_modules/semantic-ui-less
to yoursrc
- In this semantic.less file, you need change every paths:
from:
& { @import "definitions/globals/reset"; }
to:
& { @import "~semantic-ui-less/definitions/globals/reset"; }
- Find your
import 'semantic-ui-less/semantic.less'
(in your entry file) and change to:
import './semantic.less';
- Now you can comment some lines in your
semantic.less'