You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

optimize-css-assets-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optimize-css-assets-webpack-plugin - npm Package Compare versions

Comparing version

to
2.0.0

6

package.json
{
"name": "optimize-css-assets-webpack-plugin",
"version": "1.3.2",
"version": "2.0.0",
"author": "Nuno Rodrigues",
"description": "A Webpack plugin to optimize \\ minimize CSS assets.",
"dependencies": {
"cssnano": "^3.4.0",
"underscore": "^1.8.3",
"webpack-sources": "^0.1.0"
},
"peerDependencies": {
"cssnano": ">=3.4.0"
},
"main": "index.js",

@@ -12,0 +14,0 @@ "homepage": "http://github.com/NMFR/optimize-css-assets-webpack-plugin",

@@ -7,4 +7,6 @@ # Optimize CSS Assets Webpack Plugin

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).
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).
Note: To use the default CSS processor, [cssnano](http://github.com/ben-eb/cssnano) must be explicitly installed (since it's a peer dependency).
### Solves [extract-text-webpack-plugin](http://github.com/webpack/extract-text-webpack-plugin) CSS duplication problem:

@@ -14,8 +16,21 @@

## Installation:
Using npm:
```shell
$ npm install --save-dev optimize-css-assets-webpack-plugin
```
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):
```shell
$ npm install --save-dev cssnano
```
## Configuration:
The plugin can receive the following options (all of them are optional):
* assetNameRegExp: A regular expression that indicates the names of the assets that should be optimized \ minimized, defaults to `/\.css$/g`
* 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).
* cssProcessorOptions: The options passed to the cssProcessor, defaults to `{}`
* assetNameRegExp: A regular expression that indicates the names of the assets that should be optimized \ minimized, defaults to `/\.css$/g`
* 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).
* cssProcessorOptions: The options passed to the cssProcessor, defaults to `{}`
* canPrint: A boolean indicating if the plugin can print messages to the console, defaults to `true`

@@ -22,0 +37,0 @@