Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
rollup-plugin-postcss-export
Advanced tools
Seamless integration between Rollup and PostCSS, witch process the styles and bundle them into 1 external css file;
npm install rollup-plugin-postcss-export
Use rollup import system to import styles that will be later processed by rollup. The processed style are concatenated and exported into a single external file
config
import { rollup } from 'rollup';
import postcss from 'rollup-plugin-postcss-export';
rollup({
entry: 'main.js',
plugins: [
postcss({
extensions: ['.css', '.sss'] // default value
plugins: [
// cssnext(),
// yourPostcssPlugin()
],
sourceMap: true, // defult false
export: './style.css', // default false
extensions: ['.css', '.sss'] // default value
// parser: sugarss
})
]
}).then(...)
entry
import '/path/to/some_random_file.css'
The postcss-modules plugin allows you to use CSS modules in PostCSS, it requires some additional setup to use in Rollup:
import postcss from 'rollup-plugin-postcss-export';
import postcssModules from 'postcss-modules';
const cssExportMap = {};
rollup({
plugins: [
postcss({
plugins: [
postcssModules({
getJSON (id, exportTokens) {
cssExportMap[id] = exportTokens;
}
})
],
getExport (id) {
return cssExportMap[id];
}
})
]
})
That's it, you can now use CSS modules and import CSS like this:
import style from './style.css';
console.log(style.className); // .className_echwj_1
MIT © lmihaidaniel
FAQs
Rollup PostCSS plugin with export to file option
The npm package rollup-plugin-postcss-export receives a total of 6 weekly downloads. As such, rollup-plugin-postcss-export popularity was classified as not popular.
We found that rollup-plugin-postcss-export demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.