This package has been deprecated

Author message:

Renamed to @modular-css/path-resolver

modular-css-paths

15.0.0 • Public • Published

modular-css-paths NPM Version NPM License NPM Downloads

Gitter

A resolver for modular-css that will let you resolve file references against arbitrary paths. Useful to avoid code like

@value foo from "../../../../../../../../some/other/directory/file.css";

which is annoying to write, annoying to read, and also super-brittle.

Install

$ npm i modular-css-paths

Usage

Pass as part of the resolvers array in the modular-css options (via JS API/Rollup/Browserify/WebPack/etc). When modular-css is trying to resolve @value or composes file references it'll use the default node resolution algorithm against whichever paths you specified.

var Processor = require("modular-css-core"),
    paths     = require("modular-css-paths")
 
    processor = new Processor({
        resolvers : [
            paths({
                paths : [
                    "./path/one",
                    "../../some/other/path"
                ]
            })
        ]
    });

Options

paths

An array of string file paths, they can be relative to the cwd of the Processor instance or absolute paths.

Package Sidebar

Install

npm i modular-css-paths

Weekly Downloads

1

Version

15.0.0

License

MIT

Unpacked Size

8.89 kB

Total Files

5

Last publish

Collaborators

  • tivac