
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
babel-plugin-transform-import-css
Advanced tools
Injects class map imported from css-modules into js.
Plugin respects webpack css-modules API and postcss config.
npm add -SD babel-plugin-transform-import-css
.babelrc example:
{
"sourceMaps": "inline",
"presets": [
"@babel/env",
"react"
],
"plugins": [
["transform-import-css", {
"generateScopedName": "lib-[name]-[local]-[hash:base64:4]"
}]
]
}
Every js file that has a statement such as:
import classes from './Component.css'
// ... some code
will be transpiled to:
var classes = {
root: 'lib-foo-root-SFs0',
// ... some classes ...
}
require('load-styles')('.root{color:red}; ...some css...') // puts styles into the head
// ... some code
generateScopedName — css-modules scope template. Default: [name]__[local]___[hash:base64:5]configPath — postcss config path. Default: auto detectext — postcss files' extension. Typical use: ext: '.pcss'. Default: '.css'Note. Plugin rely on some @babel/ peerDependencies, that are typically included in your project by @babel/core self.
Bundling the css with npm packed library of js/react components. It is good for portability.
configPath and ext optionsrequire('load-styles')(css) inserting in that cases.postcss-load-config lib can't be used due to synchronous nature of the babel).export { classes } friendlyimport jssObject from './style.css')
Russian Fintech startup
FAQs
Injects imported styles (css-modules) into js
We found that babel-plugin-transform-import-css 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.