@css-blocks/config
Standardized access to css-blocks configuration files.
Last updated 3 days ago by chriseppstein .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @css-blocks/config 
SYNC missed versions from official npm registry.

CSS Blocks Configuration

Loads configuration for css-blocks from standardized locations so that build integrations, text editors, and the cli can all interoperate with the same configuration.

Installation

yarn add @css-blocks/config

Usage

import { Options as CSSBlocksOptions } from "@css-blocks/core";
import * as config from '@css-blocks/config';
// finds configuration starting in the current working directory.
let opts: CSSBlocksOptions | null = config.search();

// finds configuration starting in the specified directory;
opts = config.search(__dirname);

// loads a specific configuration file:
opts = config.load("config/css-blocks.js");

Configuration Options

The values specified in the configuration files are expected to be legal options for the CSS Blocks configuration. However, there are a few exceptions:

  • preprocesors - This can be set to a file location of a javascript file that exports one or more preprocessors. The properties exported should correspond to the supported syntaxes.
  • importer - This can be set to a file location of a javascript file that exports an object with keys of importer and (optionally) data. If data is returned, it takes precedence over a configuration value for importerData in the current configuration file.
  • extends - If provided, this configuration file located at the provided path is loaded and this configuration is deeply merged into it. Note: the values for importer and importerData are not deeply merged.
  • rootDir - If this configuration property is not set explicitly, the directory of the configuration file is used.

Note: Any path to another file or directory is interpreted as being relative to the directory of the file containing the path.

Current Tags

  • 1.3.0                                ...           latest (3 days ago)
  • 1.0.0-alpha.6                                ...           next (6 months ago)

12 Versions

  • 1.3.0                                ...           3 days ago
  • 1.2.0                                ...           9 days ago
  • 1.1.2                                ...           25 days ago
  • 1.1.1                                ...           a month ago
  • 1.1.0                                ...           3 months ago
  • 1.0.0                                ...           4 months ago
  • 1.0.0-alpha.6                                ...           6 months ago
  • 1.0.0-alpha.5                                ...           6 months ago
  • 1.0.0-alpha.4                                ...           8 months ago
  • 1.0.0-alpha.3                                ...           8 months ago
  • 1.0.0-alpha.1                                ...           8 months ago
  • 1.0.0-alpha.0                                ...           9 months ago
Downloads
Today 1
This Week 13
This Month 33
Last Day 1
Last Week 20
Last Month 25
Dependencies (4)
Dev Dependencies (4)

Copyright 2014 - 2017 © taobao.org |