From 40a1551fd9abe1dfd48bbcf81ba7690f2a30343a Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Sat, 17 Apr 2021 23:35:27 +0800 Subject: [PATCH] docs: add example for experimentalUseImportModule --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 3934aeeb..c288ae62 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,28 @@ When combined with `experiments.layers`, this adds a `layer` option to the loade You need to have at least webpack 5.33.2. +**webpack.config.js** + +```js +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); + +module.exports = { + plugins: [ + new MiniCssExtractPlugin({ + experimentalUseImportModule: true, + }), + ], + module: { + rules: [ + { + test: /\.css$/i, + use: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + ], + }, +}; +``` + ### Loader Options | Name | Type | Default | Description |