作者:Susan林小夕 | 来源:互联网 | 2023-01-20 11:33
我有多个主题文件,基本上是SASS文件,具有不同的变量,指定特定于每个主题的颜色,字体等.项目中的其余SASS文件在其CSS规则中使用这些变量.
我想以这样的方式配置webpack,它将为每个主题文件生成1个CSS文件.
例如:
main.scss:
body {
background-color: $theme-specific-color;
}
theme1.scss:
$theme-specific-color: blue;
theme2.scss:
$theme-specific-color: green;
所需的配置将输出2个CSS文件:
theme1.css:
body {
background-color: blue;
}
theme2.css:
body {
background-color: green;
}
我目前正在使用ExtractTextPlugin
将样式表提取到CSS中.