You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: drop webpack@4 from support, removed the cache option, removed the cacheKeys option, removed the sourceMap option, respect the devtool option by default
Copy file name to clipboardExpand all lines: README.md
+15-133
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,19 @@ If you want to run it also in development set the `optimization.minimize` option
59
59
60
60
And run `webpack` via your preferred method.
61
61
62
+
## Note about source maps
63
+
64
+
**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**
65
+
66
+
Why? Because CSS support only these source map types.
67
+
68
+
The plugin respect the [`devtool`](https://webpack.js.org/configuration/devtool/) and using the `SourceMapDevToolPlugin` plugin.
69
+
Using supported `devtool` values enable source map generation.
70
+
Using `SourceMapDevToolPlugin` with enabled the `columns` option enables source map generation.
71
+
72
+
Use source maps to map error message locations to modules (this slows down the compilation).
73
+
If you use your own `minify` function please read the `minify` section for handling source maps correctly.
74
+
62
75
## Options
63
76
64
77
### `test`
@@ -124,97 +137,6 @@ module.exports = {
124
137
};
125
138
```
126
139
127
-
### `cache`
128
-
129
-
> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
130
-
131
-
Type: `Boolean|String`
132
-
Default: `true`
133
-
134
-
Enable file caching.
135
-
Default path to cache directory: `node_modules/.cache/css-minimizer-webpack-plugin`.
136
-
137
-
> ℹ️ If you use your own `minify` function please read the `minify` section for cache invalidation correctly.
138
-
139
-
#### `Boolean`
140
-
141
-
Enable/disable file caching.
142
-
143
-
**webpack.config.js**
144
-
145
-
```js
146
-
module.exports= {
147
-
optimization: {
148
-
minimize:true,
149
-
minimizer: [
150
-
newCssMinimizerPlugin({
151
-
cache:true,
152
-
}),
153
-
],
154
-
},
155
-
};
156
-
```
157
-
158
-
#### `String`
159
-
160
-
Enable file caching and set path to cache directory.
161
-
162
-
**webpack.config.js**
163
-
164
-
```js
165
-
module.exports= {
166
-
optimization: {
167
-
minimize:true,
168
-
minimizer: [
169
-
newCssMinimizerPlugin({
170
-
cache:'path/to/cache',
171
-
}),
172
-
],
173
-
},
174
-
};
175
-
```
176
-
177
-
### `cacheKeys`
178
-
179
-
> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
Default: `false` (see below for details around `devtool` value and `SourceMapDevToolPlugin` plugin)
270
-
271
-
Enable (and configure) source map support. Use [PostCss SourceMap options](https://github.com/postcss/postcss-loader#sourcemap).
272
-
Default configuration when enabled: `{ inline: false }`.
273
-
274
-
**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**
275
-
276
-
Why? Because CSS support only these source map types.
277
-
278
-
The plugin respect the [`devtool`](https://webpack.js.org/configuration/devtool/) and using the `SourceMapDevToolPlugin` plugin.
279
-
Using supported `devtool` values enable source map generation.
280
-
Using `SourceMapDevToolPlugin` with enabled the `columns` option enables source map generation.
281
-
282
-
Use source maps to map error message locations to modules (this slows down the compilation).
283
-
If you use your own `minify` function please read the `minify` section for handling source maps correctly.
284
-
285
-
**webpack.config.js**
286
-
287
-
```js
288
-
module.exports= {
289
-
optimization: {
290
-
minimize:true,
291
-
minimizer: [
292
-
newCssMinimizerPlugin({
293
-
sourceMap:true,
294
-
}),
295
-
],
296
-
},
297
-
};
298
-
```
299
-
300
188
### `minify`
301
189
302
190
Type: `Function`
@@ -316,7 +204,6 @@ module.exports = {
316
204
minimize:true,
317
205
minimizer: [
318
206
newCssMinimizerPlugin({
319
-
sourceMap:true,
320
207
minify: (data, inputMap, minimizerOptions) => {
321
208
constpostcss=require('postcss');
322
209
@@ -476,6 +363,7 @@ Don't forget to enable `sourceMap` options for all loaders.
0 commit comments