Skip to content

Add support for specified tsconfig file #10531

Description

@ylc395

Description

There is no way to specify a tsconfig file for vite now.

See related Discussions:

#8483
#4333
#3939

Suggested solution

Provide a field named tsconfig in esbuild field of vite config.

Basically, we can pass this field to here:

const loadedTsconfig = await loadTsconfigJsonForFile(filename)

Alternative

No response

Additional context

I'm glad to implement this feature.

Validations

Activity

  1. sapphi-red commented on Oct 20, 2022

    @sapphi-red
    Member
  2. ylc395 commented on Oct 20, 2022

    @ylc395
    Author

    Yes. But what if we prefer config file, especially using extends?

  3. sapphi-red commented on Oct 20, 2022

    @sapphi-red
    Member

    In that case, using tsconfck will work as a workaround.

  4. EdieLemoine commented on Nov 17, 2022

    @EdieLemoine

    I made another workaround, a small Vite plugin that copies your other tsconfig to tsconfig.json before the build, and removes it after. It's vite-plugin-custom-tsconfig

  5. locked and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions