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
This will not force cssnano instalation if custom dependency is being used.
Also allows for more controll over the version of cssnano that will be used.
WARN: This is a breaking change.
Copy file name to clipboardExpand all lines: README.md
+19-4
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,33 @@ A Webpack plugin to optimize \ minimize CSS assets.
4
4
5
5
## What does the plugin do?
6
6
7
-
It will search for CSS assets during the Webpack build and will optimize \ minimize the CSS (by default it uses [cssnano](http://github.com/ben-eb/cssnano) but a custom css processor can be specified).
7
+
It will search for CSS assets during the Webpack build and will optimize \ minimize the CSS (by default it uses [cssnano](http://github.com/ben-eb/cssnano) but a custom CSS processor can be specified).
8
+
9
+
Note: To use the default CSS processor, [cssnano](http://github.com/ben-eb/cssnano) must be explicitly installed (since it's a peer dependency).
Since [extract-text-webpack-plugin](http://github.com/webpack/extract-text-webpack-plugin) only bundles (merges) text chunks, if its used to bundle CSS, the bundle might have duplicate entries (chunks can be duplicate free but when merged, duplicate CSS can be created).
If you are not going to specify a CSS processor you will also need to install [cssnano](http://github.com/ben-eb/cssnano) (since it's a peer dependency):
23
+
24
+
```shell
25
+
$ npm install --save-dev cssnano
26
+
```
27
+
13
28
## Configuration:
14
29
15
30
The plugin can receive the following options (all of them are optional):
16
-
* assetNameRegExp: A regular expression that indicates the names of the assets that should be optimized \ minimized, defaults to `/\.css$/g`
17
-
* cssProcessor: The css processor used to optimize \ minimize the CSS, defaults to [cssnano](http://github.com/ben-eb/cssnano). This should be a function that follows cssnano.process interface (receives a css and options parameters and returns a Promise).
18
-
* cssProcessorOptions: The options passed to the cssProcessor, defaults to `{}`
31
+
* assetNameRegExp: A regular expression that indicates the names of the assets that should be optimized \ minimized, defaults to `/\.css$/g`
32
+
* cssProcessor: The CSS processor used to optimize \ minimize the CSS, defaults to [cssnano](http://github.com/ben-eb/cssnano). This should be a function that follows cssnano.process interface (receives a CSS and options parameters and returns a Promise).
33
+
* cssProcessorOptions: The options passed to the cssProcessor, defaults to `{}`
19
34
* canPrint: A boolean indicating if the plugin can print messages to the console, defaults to `true`
0 commit comments