JSPM

@intervolga/optimize-cssnano-plugin

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 370748
  • Score
    100M100P100Q204379F
  • License MIT

WebPack 2+ plugin for CSS minification after ExtractTextPluging

Package Exports

  • @intervolga/optimize-cssnano-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@intervolga/optimize-cssnano-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

optimize-cssnano-plugin Build Status

It will search for CSS assets during the Webpack build and minimize it with cssnano. Solves extract-text-webpack-plugin CSS duplication problem.

Just like optimize-css-assets-webpack-plugin but more accurate with source maps.

Installation:

Using npm:

$ npm install --save-dev @intervolga/optimize-cssnano-plugin

Configuration:

const OptimizeCssnanoPlugin = require('@intervolga/optimize-cssnano-plugin');
module.exports = {
    module: {
        loaders: [
            { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }
        ]
    },
    plugins: [
    new ExtractTextPlugin("styles.css"),

    new OptimizeCssnanoPlugin({
      sourceMap: nextSourceMap,
      cssnanoOptions: {
        preset: ['default', {
          discardComments: {
            removeAll: true,
          },
        }],
      },
    }),
    ]
}