1.0.1 • Published 6 years ago

css-purify-webpack-loader v1.0.1

Weekly downloads
95
License
MIT
Repository
github
Last release
6 years ago

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'