November: Procrastination Month

    clean-css-loader
    TypeScript icon, indicating that this package has built-in type declarations

    4.1.1 • Public • Published

    A clean-css loader for webpack.

    clean-css-loader

    npm CI npm clean-css-loader

    Getting Started

    To begin, you'll need to install clean-css-loader:

    yarn add -D clean-css-loader

    Then add the plugin to your webpack config. For example:

    // webpack.config.js
    const isProduction = process.env.NODE_ENV === "production";
    
    module.exports = {
      module: {
        rules: [
          {
            test: /\.css$/,
            use: [
              "style-loader",
              "css-loader",
              {
                loader: "clean-css-loader",
                options: {
                  // Loader options
                  disable: !isProduction,
                  skipWarn: false,
    
                  // CleasCSS options
                  compatibility: "ie9",
                  level: 2,
                  inline: ["remote"],
                  //...
                },
              },
            ],
          },
        ],
      },
    };

    Or using plugin inline:

    // default
    import "style-loader!css-loader!clean-css-loader!./style.css";
    // with options
    import "style-loader!css-loader!clean-css-loader?level=2!./style.css";

    Options

    disable: boolean

    This option enables/disables minify, useful to easily disable on development mode (default: false)

    skipWarn: boolean

    This option enables/disables output warnings (default: false)

    sourceMap: boolean

    Enables/Disables generation of source maps. (default: compiler.devtool)

    CleanCSS module options

    Install

    npm i clean-css-loader

    DownloadsWeekly Downloads

    4,473

    Version

    4.1.1

    License

    MIT

    Unpacked Size

    17.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • retyui