Gathering detailed insights and metrics for rollup-plugin-merge-and-inject-css
Gathering detailed insights and metrics for rollup-plugin-merge-and-inject-css
Gathering detailed insights and metrics for rollup-plugin-merge-and-inject-css
Gathering detailed insights and metrics for rollup-plugin-merge-and-inject-css
Rollup plugin to merge CSS into the single style and append to the top of styles block
npm install rollup-plugin-merge-and-inject-css
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
8 Commits
2 Forks
1 Watchers
1 Branches
2 Contributors
Updated on Mar 09, 2025
Latest Version
1.1.4
Package Id
rollup-plugin-merge-and-inject-css@1.1.4
Unpacked Size
8.71 kB
Size
3.42 kB
File Count
6
NPM Version
6.14.16
Node Version
12.22.12
Published on
Jun 16, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
4
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.
1npm install --save-dev rollup-plugin-merge-and-inject-css
1yarn add rollup-plugin-merge-and-inject-css --dev
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. |
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:
1 <style> 2 .red-component { 3 color: red; 4 } 5 </style> 6 <style> 7 .blue-component { 8 color: blue; 9 } 10 </style> 11 <style> 12 .green-component { 13 color: green; 14 } 15 </style>
This plugin will produce this (if all that components are the part of a generating bundle):
1 <style> 2 /*for=example-components*/ 3 .red-component { 4 color: red; 5 } 6 .blue-component { 7 color: blue; 8 } 9 .green-component { 10 color: green; 11 } 12 </style>
The example of the rollup config with this plugin
1import autoprefixer from 'autoprefixer'; 2import Vue from 'rollup-plugin-vue'; 3import babel from 'rollup-plugin-babel'; 4import commonjs from 'rollup-plugin-commonjs'; 5import external from 'rollup-plugin-peer-deps-external'; 6import postcss from 'rollup-plugin-postcss'; 7import resolve from 'rollup-plugin-node-resolve'; 8import url from 'rollup-plugin-url'; 9import sass from 'rollup-plugin-sass'; 10import css from 'rollup-plugin-merge-and-inject-css' 11 12import pkg from './package.json'; 13 14export default { 15 input: 'src/index.js', 16 output: [ 17 { 18 file: pkg.main, 19 format: 'cjs', 20 sourcemap: true 21 }, 22 { 23 file: pkg.module, 24 format: 'es', 25 sourcemap: true 26 } 27 ], 28 plugins: [ 29 external(), 30 css({ 31 id: 'example-components' 32 }), 33 Vue({ 34 css: false, 35 style: { 36 postcssPlugins: [autoprefixer] 37 } 38 }), 39 url(), 40 babel({ 41 exclude: 'node_modules/**', 42 }), 43 resolve(), 44 commonjs(), 45 ] 46} 47
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/5 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
24 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More