-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the bug
Have a simple Rust SWC plugin:
#[plugin_transform]
fn inferno_jsx_plugin(program: Program, metadata: TransformPluginProgramMetadata) -> Program {
println!("HELLO!!!");
....
program
}
"@swc/core": "1.11.15",
Using inferno plugin: /home/sampo/git/swc-plugin-inferno/swc_plugin_inferno.wasm
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:4110/, http://[::1]:4110/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.123:4110/
<i> [webpack-dev-server] Content not from webpack is served from '/home/sampo/git/autoexplore_control_panel_ui/public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'
<i> [webpack-dev-middleware] wait until bundle finished: /
HELLO!!!
HELLO!!!
HELLO!!!
HELLO!!!
HELLO!!!
HELLO!!!
HELLO!!!
HELLO!!!
"@swc/core": "1.11.16",
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:4110/, http://[::1]:4110/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.123:4110/
<i> [webpack-dev-server] Content not from webpack is served from '/home/sampo/git/autoexplore_control_panel_ui/public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'
<i> [webpack-dev-middleware] wait until bundle finished: /
assets by path *.html 1.59 KiB
asset index.html 862 bytes [emitted]
asset blank.html 766 bytes [emitted] [from: public/blank.html] [copied]
asset js/main.js 5.93 MiB [emitted] (name: main)
asset .well-known/microsoft-identity-association.json 336 bytes [emitted] [from: public/.well-known/microsoft-identity-association.json] [copied]
asset robots.txt 25 bytes [emitted] [from: public/robots.txt] [copied]
runtime modules 26.5 KiB 13 modules
orphan modules 83.2 KiB [orphan] 12 modules
modules by path ./node_modules/ 4.13 MiB 785 modules
modules by path ./src/ 229 KiB
modules by path ./src/components/ 160 KiB 49 modules
modules by path ./src/api/*.ts 16.6 KiB 15 modules
modules by path ./src/stores/*.ts 10 KiB 7 modules
modules by path ./src/utils/*.ts 658 bytes 4 modules
modules by path ./src/validators/*.ts 1.78 KiB 4 modules
modules by path ./src/*.css 39.6 KiB 2 modules
./src/index.tsx 179 bytes [built] [code generated]
./src/b2c/msal_config.ts 454 bytes [built] [code generated]
min-document (ignored) 15 bytes [built] [code generated]
data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTs.. 7.04 KiB [built] [code generated]
webpack 5.98.0 compiled successfully in 2148 ms
Input code
import packageJSON from "./package.json" assert {type: "json"};
// SEE GITHUB ISSUE
console.log(packageJSON);
Config
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false
},
"target": "es2022",
"experimental": {
"keepImportAssertions": true,
"plugins": [["swc-plugin-inferno", {}]],
}
},
"module": {
"type": "es6"
},
"isModule": true
}
Playground link (or link to the minimal reproduction)
SWC Info output
Operating System:
Platform: linux
Arch: x64
Machine Type: x86_64
Version: #1 SMP PREEMPT_DYNAMIC Sun, 23 Mar 2025 17:17:30 +0000
CPU: (32 cores)
Models: AMD Ryzen 9 5950X 16-Core Processor
Binaries:
Node: 23.9.0
npm: 11.2.0
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
@swc/core: 1.11.16
@swc/helpers: N/A
@swc/types: 0.1.21
typescript: 5.8.2
SWC Config:
output: N/A
.swcrc path: N/A
Next.js info:
output: N/A
Expected behavior
Rust based transformer plugin is called
Actual behavior
Rust based transformer plugin is not being called
Version
1.11.16
Additional context
No response