Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
node-sass-once-importer
Advanced tools
Import files only once. If the same file is imported in multiple @import
statements, this package will ignore subsequent imports of the same file.
const sass = require('node-sass');
const onceImporter = require('node-sass-once-importer');
sass.render({
...
importer: onceImporter()
...
});
// Example:
@import 'style1.scss';
@import 'style1.scss';
@import 'style2.scss';
// Contents of style1.scss:
.selector1 { }
.selector2 { }
// Contents of style2.scss:
.selector3 { }
.selector4 { }
// webpack.config.js
const onceImporter = require('node-sass-once-importer');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader'
},
{
loader: 'sass-loader',
options: {
sassOptions: {
importer: onceImporter()
}
}
}
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
})
]
}
node-sass --importer node_modules/node-sass-once-importer/dist/cli.js -o dist src/index.scss
This module is maintained in one repository together with multiple other node-sass custom importers. The node-sass-magic-importer repository is using a monorepo approach with fixed versions for all packages. The projects maintained in the node-sass-magic-importer monorepo started out as separate repositories with separate versioning, so when they were integrated into the monorepo, the versions of all projects were raised to 5.0.0 and are in sync since then.
This module is powered by node-sass-magic-importer.
Markus Oberlehner
Website: https://markus.oberlehner.net
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
Patreon: https://www.patreon.com/maoberlehner
MIT
FAQs
Custom importer for node-sass to import files only once
The npm package node-sass-once-importer receives a total of 1,845 weekly downloads. As such, node-sass-once-importer popularity was classified as popular.
We found that node-sass-once-importer 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.