Skip to content

Latest commit

History

History
88 lines (64 loc) 路 1.56 KB

config.md

File metadata and controls

88 lines (64 loc) 路 1.56 KB

Config

config.load([pathLocation])

All available configs here

RCS will lookup first for a .rcsrc of the current directory. If there is no such file, it will lookup for a package.json with a "rcsrc": {} in it. You can also write any path in the parameters and write your own config file. This function is synchronous.

Parameters:

  • pathLocation <String> optional

Example:

const rcs = require('rename-css-selectors');

rcs.config.load();

RCS config

Just create a .rcsrc in your project root or you can add everything in your package.json with the value rcs

Example

The .rcsrc or the a own config file:

{
    "exclude": [
        "js",
        "flexbox"
    ]
}

The package.json:

{
    "name": "Your application name",
    "rcs": {
        "exclude": [
            "js",
            "flexbox"
        ]
    }
}

Exclude Classes and IDs

exclude

What if you are using something such as Modernizr and you do not want to minify some selectors?

Let's exclude 4 classes and id's: js, flexbox, canvas and svg

{
    "exclude": [
        "js",
        "flexbox",
        "canvas",
        "svg"
    ]
}

Ignore files

ignore

If you need to ignore some file or some file pattern from processing, this is how to do it using minimatch pattern (glob) Please notice that filepathes are matched absolutely.

{
    "ignore": [
      "relativeFile.js",
      "**/*.min.js",
    ]
}