![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
rollup-plugin-css-bundle
Advanced tools
Changelog
1.0.4
Uses the generateBundle
hook rather than the deprecated ongenerate
and onwrite
hooks. (#3 by @iamDecode)
Readme
A 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. Refreshingly, it preserves the order in which the CSS files are imported. Soberingly, it does not generate source maps.
# using npm
npm install --save-dev rollup-plugin-css-bundle
# using yarn
yarn add --dev rollup-plugin-css-bundle
In your rollup.config.js file:
import cssbundle from 'rollup-plugin-css-bundle';
export default {
input: 'index.js',
output: {
file: 'dist/index.js',
format: 'cjs'
},
plugins: [cssbundle()]
};
Like all well-behaved Rollup plugins, cssbundle supports the include and exclude options that filter the files on which the plugin should run.
output: String is an optional path for the extracted CSS; when ommitted, we use the bundle's file name to fashion a path for the bundled CSS.
transform: Function is available for processing the CSS, such as with postcss. It receives a string containing the code to process as its only parameter, and should return the processed code. Par exemple:
// 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! ✌️
FAQs
A Rollup plugin to extract CSS into a single external file
The npm package rollup-plugin-css-bundle receives a total of 1,732 weekly downloads. As such, rollup-plugin-css-bundle popularity was classified as popular.
We found that rollup-plugin-css-bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.