I have a common.less and a constant.less which are two common lesss.
Now, for example, if I write a pop-up box component in react, I need to introduce a demo.less.
demo.less depends on common.less and constant.less.
I will write another list component and need a list.less.
Also depends on common.less and constant.less
So I @import demo.less;@import list.less;
in list.less and demo.less respectivelyIn this way, when webpack uses less-loader, common.less and constant.less will be parsed on both sides and inserted into the head tag using style tags. It looks very painful. Please ask the experts if there is a better solution. ?
When webpack is packaging, it will package all dependencies.. Wouldn’t it be better to only reference it in one place