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.
@researchgate/babel-plugin-transform-scss-import-to-string
Advanced tools
Babel plugin for transforming SCSS imports to static variable declarations with transpiled CSS string
Babel transform plugin for replacing *.scss imports with static variable declaration as css string.
import sideEffectStyles from './styles.sass';
// vvv
const sideEffectStyles = '.foo { color: red; }';
Install the plugin first:
# yarn
yarn add --dev @researchgate/babel-plugin-transform-scss-import-to-string
# npm
npm install --save-dev @researchgate/babel-plugin-transform-scss-import-to-string
Add it to your babel configuration:
{
"plugins": ["@researchgate/babel-plugin-transform-scss-import-to-string"]
}
Or with custom node-sass
options:
{
"plugins": [
[
"@researchgate/babel-plugin-transform-scss-import-to-string",
{ "precision": 3 }
]
]
}
Import *.scss files:
// foo.scss
$bar: 42px;
.foo {
font-size: $bar;
}
// foo.js
import foo from './foo.scss';
console.log(foo); // -> .foo { font-size: 42px; }
node-sass
, which you should install explicitlybabel-core
, which you should already have with babel configuredFAQs
Babel plugin for transforming SCSS imports to static variable declarations with transpiled CSS string
The npm package @researchgate/babel-plugin-transform-scss-import-to-string receives a total of 26 weekly downloads. As such, @researchgate/babel-plugin-transform-scss-import-to-string popularity was classified as not popular.
We found that @researchgate/babel-plugin-transform-scss-import-to-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
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.