modular-css-rollup
provides a rollup build plugin you can use to transform imported .css
files into lookup objects.
$ npm i modular-css-rollup
rollup({
entry : "./index.js",
plugins : [
require("modular-css-rollup")({
css : "./gen/index.css"
})
]
}).then(function(bundle) {
...
});
import css from "modular-css-rollup";
export default {
entry : "./index.js",
dest : "./gen/bundle.js",
format : "umd",
plugins : [
css({
css : "./gen/index.css"
})
]
};
Extension to match on. Defaults to .css
. Can be used in place of include
/exclude
.
A minimatch pattern, or an array of minimatch patterns, relative to process.cwd()
. Can be used in place of ext
.
Location to write the generated CSS file to.
Location to write out the JSON mapping file for use in server rendering.
All other options are passed to the underlying Processor
instance, see Options.