Socket
Socket
Sign inDemoInstall

rollup-plugin-css-bundle

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-css-bundle - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

13

package.json
{
"dependencies": {
"fs-extra": "^5.0.0",
"rollup-pluginutils": "^2.0.1"
},
"name": "rollup-plugin-css-bundle",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/index.js",

@@ -12,2 +8,5 @@ "module": "src/index.js",

"author": "Dan Burzo <danburzo@gmail.com>",
"keywords": [
"rollup-plugin"
],
"license": "MIT",

@@ -21,2 +20,6 @@ "files": [

},
"dependencies": {
"fs-extra": "^5.0.0",
"rollup-pluginutils": "^2.0.1"
},
"scripts": {

@@ -23,0 +26,0 @@ "build": "rollup -c",

# rollup-plugin-css-bundle
Rollup plugin to extract CSS into a single external file.
A [Rollup](https://github.com/rollup/rollup) plugin whose sole purpose is to collect all the CSS files you import into your project and bundle them into a single glorious CSS file.
## Usage
```js
// rollup.config.js
import cssbundle from 'rollup-plugin-css-bundle';
export default {
input: 'index.js',
output: {
file: 'dist/index.js',
format: 'cjs'
},
plugins: {
cssbundle()
}
}
```
## Options
Like all well-behaved Rollup plugins, `cssbundle` supports the `include` and `exclude` options that let you configure on which files the plugin should run. Additionally:
__output__: _String_ is an optional path wherein to put the extracted CSS; when ommitted, we use the bundle's filename to fashion a name for the bundled CSS.
__transform__: _Function_ is available for processing the CSS, such as with [postcss](https://github.com/postcss/postcss). It receives a string containing the code to process as its only parameter, and should return the processed code:
```js
// rollup.config.js
import cssbundle from 'rollup-plugin-css-bundle';
import postcss from 'postcss';
import autoprefixer from 'autoprefixer';
export default {
input: 'index.js',
output: {
file: 'dist/index.js',
format: 'cjs'
},
plugins: [
cssbundle({
transform: code => postcss([autoprefixer]).process(code, {})
})
]
};
```
That's it. Enjoy! ✌️
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc