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

feat(cli): allow to specify sourcemap mode via --sourcemap build's option #11505

Merged
merged 3 commits into from Feb 22, 2023

Conversation

wreckah
Copy link
Contributor

@wreckah wreckah commented Dec 27, 2022

Description

Currently there are no ways to set build.sourcemap to hidden via CLI. But it may be useful to set it on different environments without customization of Vite config, for example in CI:

# On staging:
npm run build -- --sourcemap
# On production:
npm run build -- --sourcemap hidden

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Dec 28, 2022
@bluwy bluwy changed the title chore(cli): allow to specify sourcemap mode via --sourcemap build's option feat(cli): allow to specify sourcemap mode via --sourcemap build's option Dec 28, 2022
bluwy
bluwy previously approved these changes Dec 28, 2022
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code and behavior looks good to me!

Would you update this part, too?

| `--sourcemap` | Output source maps for build (default: `false`) (`boolean`) |

@wreckah
Copy link
Contributor Author

wreckah commented Dec 31, 2022

Would you update this part, too?

| `--sourcemap` | Output source maps for build (default: `false`) (`boolean`) |

@sapphi-red sure d981c0c

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sapphi-red sapphi-red added this to the 4.2 milestone Feb 17, 2023
@bluwy bluwy merged commit ee3b90a into vitejs:main Feb 22, 2023
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
@ivana-helvin
Copy link

Hi I don't know how to add this to my vite 4.1.4, please can you help?

@bluwy
Copy link
Member

bluwy commented Feb 27, 2023

We will only ship this in Vite 4.2 when it's released.

@patak-dev
Copy link
Member

@ivana-helvin you can test it now at vite@4.2.0-beta.0 (stable release will probably take ~10-15 days)

@wreckah wreckah deleted the build-cli-sourcemap-hidden branch February 27, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants