We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ test: /.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', ], },
如老师以上代码, 当我想要加上sass的支持的时候, 我马上增加了如下匹配规则
{ test: /.s[ac]ss$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader' ] },
但是在编译过程中, 发现scss后缀的文件会被匹配到css的规则上, 导致产生两次编译而报错, 错误如下
scss
css
Didn't get a result from child compiler
debug了一下发现, 是因为两次匹配导致css的规则匹配错误, 导致编译产物为空造成的
因此建议修改一下/.css$/ 为 /\.css$/, 如果需要使用sass, 则使用 /\.s[ac]ss$/,作为匹配规则, 避免正则下.未转义产生的问题
/.css$/
/\.css$/
/\.s[ac]ss$/,
.
以上
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如老师以上代码, 当我想要加上sass的支持的时候, 我马上增加了如下匹配规则
但是在编译过程中, 发现
scss
后缀的文件会被匹配到css
的规则上, 导致产生两次编译而报错, 错误如下debug了一下发现, 是因为两次匹配导致css的规则匹配错误, 导致编译产物为空造成的
因此建议修改一下
/.css$/
为/\.css$/
, 如果需要使用sass, 则使用/\.s[ac]ss$/,
作为匹配规则, 避免正则下.
未转义产生的问题以上
The text was updated successfully, but these errors were encountered: