Skip to content

tsconfig target is not ignored for both dev and build #10167

@htmnk

Description

@htmnk

Describe the bug

When target: es5 is set in tsconfig.json and vite.config.ts exists, Vite fails to start

with esbuild errors

ERROR: Transforming const to the configured target environment ("ES5") is not supported yet

Seems to be an issue with 3.1.0 and up

working example with 3.0.9:

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

very likely related to

#9457

Reproduction

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

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    vite: ^3.1.0 => 3.1.0

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    has workaroundp4-importantViolate documented behavior or significantly improves performance (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions