What are the problems encountered by webpack in configuring the css extraction plug-in?

//
   module: {
    {
      test: /\.scss$/,
      use: [
        "style-loader",
        {
          loader: "css-loader",
          options: { modules: true }
        },

configuration example given on the official website

MiniCssExtractPlugincss-loadercss Module
vue-style-loader style-loader
----------------------------------------------------------------------

Apr.07,2021

use is an array, the comma is preceded by a ternary expression, and use: ['vue-style-loader',' css-loader'] is use: [MiniCssExtractPlugin.loader] if it is not a production environment. In fact, run dev uses vue-style-loader, run build to use MiniCssExtractPlugin.loader
you can copy your css-loader object directly instead of css-loader on the right

Menu