We don’t alter the original file, we simply swap the Semantic UI entry point with one of our own which “tells” webpack the components of which the CSS should be produced.

If you are using CSS Modules then what you’ re saying could be the way to go, by explicitly default-importing the LESS declarations of each component in the corresponding JS file. You should also be careful about duplicate declarations.

If you’ re not using CSS modules and you simply want to import the LESS declarations of the specific component that you’ ll be using, then what i’m proposing does the exact same thing a bit more organized and “Semantic-y”.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store