I have the following swc configuration in place, but when I compile them with nest.js swc, the tsx files are not compiled at all and no artifact is created for them.
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"module": {
"type": "commonjs"
},
"jsc": {
"target": "es2017",
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": true,
"dynamicImport": true,
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true,
"react": {
"refresh": true
}
},
"keepClassNames": true,
"baseUrl": "./"
},
"minify": false
}
Trying to figure out what am I doing wrong?
Set the extensions in your nest-cli.json file.
"compilerOptions": {
"builder": {
"type": "swc",
"options": {
"extensions": [".js", ".ts", ".jsx", ".tsx"]
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With