New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

custom-property-extract-loader

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-property-extract-loader

Webpack loader for custom-property-extract


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created

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

NameTypeRequiredDefaultDescription
mode{String}false"simple"Output mode ("simple", "full")
syntax{String}false"css"Syntax of the source stylesheet ("css", "scss", "sass")
prefix{Boolean}falsetrueDetermines whether to prefix custom properties with --.

FAQs

Package last updated on 19 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts