
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
node-sass-once-importer
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
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
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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.