![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
babel-plugin-transform-import-css
Advanced tools
Injects imported styles (css-modules) into js
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
The npm package babel-plugin-transform-import-css receives a total of 178 weekly downloads. As such, babel-plugin-transform-import-css popularity was classified as not popular.
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.