css-imports
find all @import
urls in the css file DEEPLY
Install
npm install --save cssimoprts
Usage
var cssimoprts = ; ;
You can specify the option.deep
to true
to get the imports deeply, specify the option.flatten
to true
to put all imports into a single array.
Example
entry.css
;;;
a.css
;
b.css
;
The imports would be as follow:
[
{
path: 'a.css',
condition: '',
rule: '@import url(a.css)',
absolutePath: 'path/to/a.css'
}, {
path: 'b.css',
condition: 'only and (max-width: 320px)',
rule: '@import url(b.css) only and (max-width: 320px)',
absolutePath: 'path/to/b.css'
}, {
path: 'http://localhost/c.css',
condition: '',
rule: '@import url(http://localhost/c.css),
absolutePath: 'http://localhost/c.css'
}
]
LICENSE
MIT