GitHub - herberttn/vite-plugin-typescript-transform: Applies the TypeScript compiler during vite's transform build phase. | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

herberttn/vite-plugin-typescript-transform

Repository files navigation

vite-plugin-typescript-transform

ci npm license

Applies the TypeScript compiler during Vite transform build phase.

This plugin may allow the use of language features not yet supported by vite's default compiler, esbuild.

Install

npm install --save-dev vite-plugin-typescript-transform

Options

See the Options interface and its inline documentation.

Warning

This plugin does not change or disable any of vite's compiler/features/options. It only transpiles the code using the typescript compiler and lets vite move on with the transpiled code.

Transform ECMAScript decorators

The new ECMAScript decorators are not supported by esbuild (yet), but they are supported by typescript since v5 (see the announcement). This example down-levels the new decorators into code that is usable in runtimes that do not yet support it.

import ts from 'typescript';
import { defineConfig } from 'vite';
import { vitePluginTypescriptTransform } from 'vite-plugin-typescript-transform';

export default defineConfig({
  // ...your vite configuration
  plugins: [
    vitePluginTypescriptTransform({
      enforce: 'pre',
      filter: {
        files: {
          include: /\.ts$/,
        },
      },
      tsconfig: {
        override: {
          target: ts.ScriptTarget.ES2021,
        },
      },
    }),
  ],
});

About

Applies the TypeScript compiler during vite's transform build phase.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.