
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
swc-plugin-transform-cx-imports
Advanced tools
Rewrite Cx imports for simplicity and optimal output size.
Having improved performance, this plugin replaces babel-plugin-transform-cx-imports.
src files which may result in smaller builds:import { TextField } from 'cx/widgets'
becomes
import { TextField } from 'cx/src/form/TextField'
import { TextField } from 'cx/widgets'
also adds
import 'cx/src/form/TextField.scss'
Install the package using the yarn add swc-plugin-transform-cx-imports command. This plugin requires another plugin, which you can install using the yarn add swc-plugin-transform-cx-jsx.
Inside the webpack.config.js file, import manifest from 'cx/manifest' - const manifest = require('cx/manifest');, and replace babel-loader with swc-loader:
{
loader: 'swc-loader',
options: {
jsc: {
loose: true,
target: 'es2022',
parser: {
syntax: 'typescript',
decorators: true,
tsx: true,
},
experimental: {
plugins: [
[
require.resolve('swc-plugin-transform-cx-jsx/swc_plugin_transform_cx_jsx_bg.wasm'),
{ trimWhitespace: true, autoImportHtmlElement: true },
],
[
require.resolve('swc-plugin-transform-cx-imports/swc_plugin_transform_cx_imports_bg.wasm'),
{ manifest, useSrc: true },
],
],
},
transform: {
react: {
pragma: 'VDOM.createElement',
},
},
},
},
}
FAQs
Rewrite Cx imports for simplicity and optimal output size.
The npm package swc-plugin-transform-cx-imports receives a total of 322 weekly downloads. As such, swc-plugin-transform-cx-imports popularity was classified as not popular.
We found that swc-plugin-transform-cx-imports demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.