css-purify-webpack-loader

a webpack loader to purify css.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
css-purify-webpack-loader
1.0.16 years ago6 years agoMinified + gzip package size for css-purify-webpack-loader in KB

Readme

css-purify-webpack-loader
css-purify-webpack-loader is a webpack loader that take css an purify it, it is usefull in some senarios.

Usage

npm i --D css-purify-webpack-loader

rules=[
        {
          ...
          use: [
            ...
            {
              loader: 'css-purify-webpack-loader',
              options: {
                includes: [
                  './pages/*.js',
                  './components/**/*.js',
                  './containers/**/*.js'
                ],
              },
            }
            ...
          ],
        }
    ]

css-purify-webpack-loader uses purify-css,
Options:

includes:

Specify the files to include in the purify process and must obey the glob file pattern, this option is necessary.

purifyCssOptions:

If you want to pass options to the purify-css then use this, the default is : { minify: true, info: true, }

when:

Is a boolean that specify when to run the purification, the default is process.env.NODE_ENV === 'production'