Unable to disable source maps
Reproduction using @swc/[email protected].
scripts/.swcrc contents:
{
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2021"
}
}
Steps:
-
node_modules/.bin/swc promiseSettledAggregate.ts -o dist/promiseSettledAggregate.js --config-file scripts/.swcrc - See added
promiseSettledAggregate.js.mapindist - Delete
dist/promiseSettledAggregate.js.map - Run
npm install @swc/[email protected]and re-run first step, and see now there is no longerpromiseSettledAggregate.js.map
Expected behaviour:
Only emit promiseSettledAggregate.js.map if sourceMaps is enabled in config file. Do not emit if sourceMaps is omitted or set to false.
It seems the issue is swc is not reading sourceMaps boolean value correctly from .swcrc - only "inline" has effect, but not true or false - sourcemaps will always be generated unless "inline" is specified.
I have found that this issue is consistent whether using --config-file flag on CLI or not.
I haven't had time to investigate this yet but I am still seeing this bug on latest version @kdy1 - do you know the cause?
No, I don't know how sourceMaps can be true while there's no .swcrc and sourceMaps is not specified while invoking @swc/core