Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
rollup-plugin-sass
Advanced tools
npm install rollup-plugin-sass -D
import { rollup } from 'rollup';
import sass from 'rollup-plugin-sass';
rollup({
entry: 'main.js',
plugins: [
sass()
]
}).then(...)
output
Boolean|String|Function
(default: false)sass({
// Default behaviour disable output
output: false,
// Write all styles to the bundle destination where .js is replaced by .css
output: true,
// Filename to write all styles
output: 'bundle.css',
// Callback that will be called ongenerate with two arguments:
// - styles: the concatentated styles in order of imported
// - styleNodes: an array of style objects:
// [
// { id: './style1.scss', content: 'body { color: red };' },
// { id: './style2.scss', content: 'body { color: green };' }
// ]
output(styles, styleNodes) {
writeFileSync('bundle.css', styles);
}
});
insert
Boolean
(default: false)If you specify true
, the plugin will insert compiled CSS into <head/>
tag.
processor
Function
(default: null)If you specify a function as processor which will be called with compiled css before generate phase.
import sass from 'rollup-plugin-sass'
import autoprefixer from 'autoprefixer'
import postcss from 'postcss'
sass({
// Processor will be called with two arguments:
// - style: the compiled css
// - id: import id
processor: css => postcss([autoprefixer])
.process(css)
.then(result => result.css)
});
options
Object
(default: null)Options for node-sass.
If you specfiy data
, the plugin will treat as prepend sass string.
Since you can inject variables during sass compilation with node.
sass({
options: {
data: '$color: #000;'
}
})
MIT © BinRui.Guan
FAQs
Rollup Sass files.
We found that rollup-plugin-sass demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.