How to package sass global variables on demand when gulp is packaged

< H2 > questions such as questions < / H2 >
//
//
@import "../base/base";

//iconfont
@import "../font/iconfont-180726.scss";        //iconfont

as above, this scss file is a public package, and the page has its own separate scss file that references the current common class package. When I am packing, I use gulp-sass to package, and some styles that are not used in the current page are generally packaged, resulting in the packaged css file with a lot of irrelevant css . How can I solve this problem?

Jan.22,2022

as you say, I understand that you defined it in the public package, and then referenced the public package on the current page, so this problem should arise, and the introduction is equivalent to adding content to the public package. So my suggestion is that you package the styles that are not referenced on all pages in the public package and take them out separately

Menu