28.0.0 • Published 3 years ago

@modular-css/path-resolver v28.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

@modular-css/path-resolver NPM Version NPM License NPM Downloads

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/path-resolver

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.

const Processor = require("@modular-css/processor");
const paths     = require("@modular-css/path-resolver");

const 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.

28.0.0

3 years ago

27.1.0

3 years ago

27.0.3

4 years ago

27.0.0

4 years ago

26.0.0

4 years ago

25.4.1

5 years ago

25.0.0

6 years ago

24.2.1

6 years ago

24.0.1

6 years ago

24.0.0

6 years ago

23.0.0

6 years ago

22.1.4

6 years ago

22.0.0

6 years ago

21.1.1

6 years ago

21.0.0

6 years ago

20.0.0

6 years ago

19.0.0

7 years ago

18.0.0

7 years ago

17.1.2

7 years ago

17.0.0

7 years ago

16.0.0

7 years ago