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

fix: ignore tsconfig target when bundling config #9457

Merged

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Jul 30, 2022

Description

When target: es5 is set in tsconfig.json and vite.config.ts exists, Vite fails to start.
This is because esbuild looks for that when bundling config.

Because we always ignore target in tsconfig.json and users won't expect target field to be respected for config loading, I think it is better to ignore target field here too.

reproduction: https://stackblitz.com/edit/vitejs-vite-h1gxde?file=vite.config.ts&terminal=dev

Additional context

related discussion: #3827


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 Commit 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.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jul 30, 2022
@bluwy bluwy merged commit c5e7895 into vitejs:main Aug 1, 2022
@sapphi-red sapphi-red deleted the fix/ignore-tsconfig-target-for-config branch August 1, 2022 05:35
@htmnk
Copy link

htmnk commented Sep 19, 2022

@sapphi-red @bluwy This seems to be broken again,

works when I downgrade to 3.0.9 on your repro link

https://stackblitz.com/edit/vitejs-vite-h1gxde?file=package.json&terminal=dev

doesn't work with 3.1.0+

@patak-dev
Copy link
Member

@htmnk would you create a new issue with a reproduction against latest so we can properly track the regression? Thanks!

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.

5 participants