fix(server): only warn sourcemap in `loadTransform` when explicitly turned on
Description
We got quite some warnings regarding sourcemap when we never need them, and it seems there is no way to disable it:
This kind of warning is generally useless but quite annoying to the end users. I think it make more sense only to warn when sourcemap is enabled.
Additional context
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines, especially the Pull Request Guidelines.
- [x] 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). - [ ] Update the corresponding documentation if needed.
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
Run & review this pull request in StackBlitz Codeflow.
@antfu are you still interested in pushing forward this PR? I had update the warning in https://github.com/vitejs/vite/pull/16170 to print the entire error instead, and I usually find actual configuration error that should be fixed instead of hiding.
I'll close this for now as the updated warning should be more helpful now.