Package Exports
- @fomantic/rework-import
- @fomantic/rework-import/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fomantic/rework-import) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rework-import 
Forked Version using updated dependencies
Original repo at https://github.com/reworkcss/rework-import
Import stylesheets using
@importand an optional media query
Install
$ npm install --save rework-importUsage
var data = require('fs').readFileSync('index.css');
var imprt = require('rework-import');
var rework = require('rework');
rework(data)
.use(imprt({path: 'app/stylesheets'}))
.toString();Options
encoding
Type: String
Default: utf8
Use if your CSS is encoded in anything other than UTF-8.
path
Type: Array|String
Default: process.cwd() or __dirname of the rework source
A string or an array of paths in where to look for files.
Note: nested @import will additionally benefit of the relative dirname of imported files.
transform
Type: Function
A function to transform the content of imported files. Takes one argument and should return the modified content. Useful if you use css-whitespace.
Example
@import 'foo.css' (min-width: 25em);
body {
background: black;
}yields:
@media (min-width: 25em) {
body {
background: red;
}
h1 {
color: grey;
}
}
body {
background: black;
}License
MIT © Jason Campbell and Kevin Mårtensson