Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

webpack validationerror: invalid options object. mini css extract plugin loader has been initialized using an options object that does not match the api schema.

//in webpack.config.js
// for release v1.3.0
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
  plugins: [new MiniCssExtractPlugin()],
  module: {
    rules: [
      {
        test: /.css$/i,
        use: [MiniCssExtractPlugin.loader, "css-loader"],
      },
    ],
  },
};
⚠️ Note that if you import CSS from your webpack entrypoint or import styles in
the initial chunk, mini-css-extract-plugin will not load this CSS into the page.
Please use html-webpack-plugin for automatic generation link tags or create index.html
file with link tag.
 
PREVIOUS NEXT
Tagged: #webpack #invalid #options #mini #css #extract #plugin #loader #initialized #options #object #match #api
ADD COMMENT
Topic
Name
5+2 =