3

我有以下 webpack 配置:

规则:

{
    test: /\.scss$/,
    use: [
        MiniCssExtractPlugin.loader,
        {
            loader: 'css-loader',
            options: {
                sourceMap: false
            }
        }, {
            loader: 'sass-loader',
            options: {
                sourceMap: false,
                processCssUrls: false
            }
        }
    ]
}

插件:

new MiniCssExtractPlugin({
    filename: '[name].css',
    chunkFilename: '[id].css'
})

在构建和观察输出时,SpeedMeasurePlugin我得到这样的输出:

mini-css-extract-plugin, and 
css-loader, and 
sass-loader took 12.73 secs
  module count = 1
css-loader, and 
sass-loader took 12.66 secs
  module count = 1

为什么 sass 会编译两次?

4

1 回答 1

0

它是 MiniCssExtractPlugin 运行 sass-loader 两次。不知道为什么。

于 2019-12-05T00:00:29.027 回答