Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to disable source maps #73

Open
stefee opened this issue Oct 8, 2021 · 3 comments
Open

Unable to disable source maps #73

stefee opened this issue Oct 8, 2021 · 3 comments

Comments

@stefee
Copy link

stefee commented Oct 8, 2021

Reproduction using @swc/[email protected].

scripts/.swcrc contents:

{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2021"
  }
}

Steps:

  1. node_modules/.bin/swc promiseSettledAggregate.ts -o dist/promiseSettledAggregate.js --config-file scripts/.swcrc
  2. See added promiseSettledAggregate.js.map in dist
  3. Delete dist/promiseSettledAggregate.js.map
  4. Run npm install @swc/[email protected] and re-run first step, and see now there is no longer promiseSettledAggregate.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.

@stefee
Copy link
Author

stefee commented Oct 8, 2021

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.

@stefee
Copy link
Author

stefee commented Oct 30, 2021

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?

@stefee stefee changed the title Unable to disable source maps on CLI v0.1.51 Unable to disable source maps Oct 30, 2021
@kdy1
Copy link
Member

kdy1 commented Oct 30, 2021

No, I don't know how sourceMaps can be true while there's no .swcrc and sourceMaps is not specified while invoking @swc/core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants