Skip to content

Dschungelabenteuer/custom-property-extract-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-property-extract-loader

Webpack loader for custom-property-extract.

Install

Requires custom-property-extract as peer dependency.

npm install --save-dev custom-property-extract custom-property-extract-loader

Usage

In require:

const variables = require('!custom-property-extract!./style.scss');

In webpack config:

{
  module: {
    loaders: [
      {
        test: /.s[ca]ss$/,
        loader: 'custom-property-extract-loader'
      }
    ]
  }
}

Beware! If you are using commonly used loaders such as css-loader or scss-loader to actually generate and import stylesheets content, using the loader in the webpack config is not recommended unless you give webpack a way to distinguish stylesheets used for custom properties definitions and stylesheets used for styling (e.g. by tweaking the test properties).

Options

Name Type Required Default Description
mode {String} false "simple" Output mode ("simple", "full")
syntax {String} false "css" Syntax of the source stylesheet ("css", "scss", "sass")
prefix {Boolean} false true Determines whether to prefix custom properties with --.

About

Webpack loader for custom-property-extract

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published