2.0.0 • Published 2 years ago

rcs-webpack-plugin v2.0.0

Weekly downloads
91
License
MIT
Repository
github
Last release
2 years ago

MIT Licence npm version Build Status Coverage Status

Contents

Installation

With NPM v7+:

$ npm i rcs-webpack-plugin -D

With prior NPM versions:

$ npm i rcs-webpack-plugin rcs-core rename-css-selectors -D

Usage

import rcs from 'rcs-core'; // just import this if you want to change the options on the core directly
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import RcsWebpackPlugin from 'rcs-webpack-plugin';

// following methods also allow array of strings and RegExp
rcs.selectorLibrary.setExclude('my-selector'); // if you want to exclude a specific selector
rcs.selectorLibrary.set('my-custom-selector'); // if you want to include custom selectors which are not in css files
// check out github.com/JPeer264/node-rcs-core/blob/7e3ebb872964f49bf82c84f6920005610a3d252a/docs/api for more information

export default {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          { loader: MiniCssExtractPlugin.loader },
          'css-loader',
        ],
      },
    ],
  },
  plugins: [
    new MiniCssExtractPlugin(),
    new RcsWebpackPlugin(),
  ],
};

Options

fillLibraries (boolean)

fillLibraries is to wether or not rcs should get prefilled with selectors. Turning off is usefull if you used postcss-rcs or plain rcs-core.

Default: true

fillLibrariesOptions (object)

fillLibrariesOptions just applies if { fillLibraries: true }. These options are the same as rcs-core@fillLibraries

espreeOptions (object)

espreeOptions are mainly for the JS parsing. These options are the same as rcs-core@replaceJs

experimentalHandlebarsVariables

If you use handlebars and have variables in your JavaScript for dynamic content creation

Default: false

LICENSE

MIT © Jan Peer Stöcklmair

2.0.0

2 years ago

1.4.2

3 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago