1.0.3 • Published 5 years ago

@atomico/rollup-plugin-import-css v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

@atomico/rollup-plugin-import-css

This plugin allows you to import the css content as a module, to be used inside the <style>{style}</style> tag inside the shadowDom, the css reading is done through postcss so you can include the plugins that you consider convenient for the construction of your css.

The activation of this plugins only happens when the CSS code is required otherwise it will ignore the import.

import style from "style.css"; // sync
import("style.css"); // dinamic

install

yarn add @atomico/rollup-plugin-import-css

usage

import importCss from "@atomico/rollup-plugin-import-css";

options

let options = {
	include: ["**/*.css"],
	explude: [],
	minimize: true, // will add the list of plugins cssnano
	plugins: [],
	/**
	 * this function allows you to manipulate the return of the module
	 * allowing, alter the export to be decorated by
	 * other libraries
	 */
	generate(code) {
		return `export default ${JSON.stringify(code.toString())};`;
	}
};
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago