Webpack plugin to wrap all CSS classes in a container


1.0.86 years ago6 years agoMinified + gzip package size for @coorpacademy/css-wrapper-webpack-plugin in KB


Disclaimer: you should use this plugin with minified css only.

What it does

Providing your minified styles.css is:

.plop {opacity: .5;}.plup {height: 12px;}

the final css will be wrapped with your container

#app .plop {opacity: .5;}#app .plup {height: 12px;}


require the plugin

const WebpackCSSWrapperPlugin = require('@coorpacademy/webpack-css-wrapper');

then within your webpack plugins:

  plugins: [
    new ExtractTextWebpackPlugin('styles.css'),
    new WebpackCSSWrapperPlugin('styles.css', '#app')

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.