csso-webpack-plugin
CSSO minification files to serve your webpack bundles
Last updated 10 months ago by zoobestik .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install csso-webpack-plugin 
SYNC missed versions from official npm registry.

CSSO Webpack Plugin

npm node dependencies status downloads

Logo

Why is not csso-loader or postcss-csso?

  • Full restructuring in bundles: better

  • No problems with custom syntax like css-modules:global(.c .d) .a { color: #fff; } syntax

  • Possible to generate both pure and minimized versions at the same time.

Install

npm i -D csso-webpack-plugin

For node < 8.0.0 use 1.x version with csso@^3:

npm i -D csso-webpack-plugin@1

Usage

Plugin good to use in pair with ExtractTextPlugin or MiniCssExtractPlugin.

const CssoWebpackPlugin = require('csso-webpack-plugin').default;

module.exports = {
  module: { /* ... */ },
  plugins: [
    new MiniCssExtractPlugin({
      filename: "[name].css",
      chunkFilename: "[id].css"
    }),
    new CssoWebpackPlugin(),
  ]
}

Options

new CssoWebpackPlugin([options: CssoOptions], [filter: function | RegExp])

Arguments:

  • optionscsso options.
  • options.pluginOutputPostfixfunction(file) or string postfix, if passed, plugin will create two assets vanilla and compressed. Example:
    {
        plugins: [
            new ExtractTextPlugin('test.css'),
            new CssoWebpackPlugin({ pluginOutputPostfix: 'min' })
            /* Generated:
                test.css — uncompressed file
                test.min.css — minimized with csso file
            */
        ]
    }
    
  • filter — Detect should be file processed. Defaults: to ends with .css.

Flow support

I don't now why, but plugin ships with flow typings (typedef too). To use them in your project, add this to the [libs] section of your .flowconfig:

[libs]
node_modules/csso-webpack-plugin/lib/index.js.flow

Acknowledgements

Develop By Logo By MIT license

Current Tags

  • 2.0.0-beta.1                                ...           latest (10 months ago)

17 Versions

  • 2.0.0-beta.1                                ...           10 months ago
  • 1.0.0-beta.12                                ...           3 years ago
  • 1.0.0-beta.11                                ...           3 years ago
  • 1.0.0-beta.10                                ...           3 years ago
  • 1.0.0-beta.9                                ...           3 years ago
  • 1.0.0-beta.8                                ...           3 years ago
  • 1.0.0-beta.7                                ...           3 years ago
  • 1.0.0-beta.6                                ...           4 years ago
  • 1.0.0-beta.5                                ...           4 years ago
  • 1.0.0-beta.4                                ...           4 years ago
  • 1.0.0-beta.3                                ...           4 years ago
  • 1.0.0-beta.2                                ...           4 years ago
  • 1.0.0-beta.1                                ...           4 years ago
  • 1.0.0-alpha.4                                ...           4 years ago
  • 1.0.0-alpha.3                                ...           4 years ago
  • 1.0.0-alpha.2                                ...           4 years ago
  • 1.0.0-alpha                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |