15.0.0 • Published 6 years ago

modular-css-webpack v15.0.0

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

modular-css-webpack NPM Version NPM License NPM Downloads

Webpack 2/3/4 support for modular-css.

This package contains two entry points, you will need to use both in tandem for things to work!

  1. modular-css-webpack/plugin provides a webpack plugin you can use to transform imported .css files into lookup objects while outputting CSS to disk.

  2. modular-css-webpack/loader provides the file loader that does the actual transformation on files.

Usage

// webpack.config.js
var path = require("path"),
    
    CSSPlugin = require("modular-css-webpack/plugin");

module.exports = {
    entry   : "./input.js",
    output  : {
        path : path.resolve(__dirname, "dist"),
        filename : "./output.js"
    },
    module : {
        rules : [{
            test : /\.css$/,
            use  : "modular-css-webpack/loader"
        }]
    },
    plugins : [
        new CSSPlugin({
            css  : "./output.css",
            json : "./output.json"
        })
    ]
});

Options

Plugin Options

css

Location to write the generated CSS file to, relative to output.path just like output.filename

json

Location to write out the JSON mapping file to, relative to output.path just like output.filename

Shared Options

All other options are passed to the underlying Processor instance, see Options.

Loader Options

namedExports

By default this plugin will create both a default export and named exports for each class in a CSS file. You can disable this by setting namedExports to false.

...
    module : {
        rules : [{
            test : /\.css$/,
            use  : {
                loader  : "modular-css-webpack/loader",
                options : {
                    namedExports : false
                }
            }
        }]
    },
...
15.0.0

6 years ago

14.4.0

6 years ago

14.3.0

6 years ago

14.2.1

6 years ago

14.2.0

6 years ago

14.1.0

6 years ago

14.0.1

6 years ago

14.0.0

6 years ago

13.0.0

6 years ago

12.1.3

6 years ago

12.1.2

6 years ago

12.1.0

6 years ago

12.0.2

6 years ago

12.0.1

6 years ago

12.0.0

6 years ago

11.0.0

6 years ago

10.1.0

6 years ago

10.0.0

6 years ago

9.0.0

6 years ago

8.2.0

6 years ago

8.1.0

6 years ago

8.0.3

6 years ago

8.0.2

6 years ago

8.0.1

6 years ago

8.0.0

6 years ago

7.2.0

6 years ago

7.1.0

6 years ago

7.0.0

6 years ago

6.1.0

6 years ago

6.0.2

7 years ago

6.0.1

7 years ago

6.0.0

7 years ago

5.2.4

7 years ago

5.2.3

7 years ago

5.2.2

7 years ago

5.2.1

7 years ago

5.2.0

7 years ago

5.1.1

7 years ago

5.1.0

7 years ago

5.0.0-rc1

7 years ago

5.0.0-0

7 years ago

4.4.0

7 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.0

7 years ago

4.1.4

7 years ago

4.1.3

7 years ago

4.1.2

7 years ago

4.1.0

7 years ago

4.0.6

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago