Skip to content

gbk/export-css-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

export css loader for webpack

installation

npm install export-css-loader --save-dev

Usage

Documentation: Using loaders

require("export-css!css!./file.css");

Writes css code into a output file ( [options.output.path]/[name].css ).

This loader MUST be added before css-loader.

css-loader

Example config

This webpack config can load css files, embed small png images as Data Urls and jpg images as files.

module.exports = {
  module: {
    loaders: [
      { test: /\.css$/, loader: "export-css-loader!css-loader" },
      { test: /\.png$/, loader: "url-loader?limit=100000" },
      { test: /\.jpg$/, loader: "file-loader" }
    ]
  }
};

Query Parameters

  • remove {boolean | Default to false}

Remove CSS content from module to reduce the size of the bundle.

  • write {boolean | Default to true}

Write CSS content into css file.

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

export css loader for webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published