rollup-plugin-merge-and-inject-css
A rollup plugin to collect and combine all the imported css file and inject them to the head at the top of style blocks list.
Install
npm install --save-dev rollup-plugin-merge-and-inject-css
yarn add rollup-plugin-merge-and-inject-css --dev
Plugin options
Name | Type | Required | Description |
---|---|---|---|
id | String | false | The id of your rollup build, it's needed to update build properly in watch mode. Default value is the random uid for a current watch run. |
Usage
The common scenario for using this plugin is the merging of css files produced by different component. For example, it's useful for rollup-plugin-vue.
The default inject tool of this plugin will produce something like that:
This plugin will produce this (if all that components are the part of a generating bundle):
Example
The example of the rollup config with this plugin
;;;;;;;;; ; input: 'src/index.js' output: file: pkgmain format: 'cjs' sourcemap: true file: pkgmodule format: 'es' sourcemap: true plugins: