A Svelte preprocessor that compiles TypeScript in Svelte files using esbuild. Version 3.0.1 is the latest stable release. It offers faster TypeScript compilation compared to svelte-preprocess's Babel-based TypeScript support, with a subset of esbuild's transform options. It provides both a `typescript` function and a `replace` function for define replacements. Ships TypeScript typings. Peer dependencies: esbuild >=0.14.0 and svelte >=3.5.0. Requires Node >=10. Maintained primarily by lukeed, with stable release cadence.
npm install svelte-preprocess-esbuildVerified import paths — ran on the pinned version, not inferred.
Configures Svelte to use esbuild for TypeScript compilation alongside svelte-preprocess, with example options for target and define.
Add `preprocess({ typescript: false })` after the `typescript` preprocessor from this package.Use the `replace` function separately if you want define replacements only on non-TypeScript scripts.
Do not pass `minify`; it is always false.
Use named imports: `import { typescript } from 'svelte-preprocess-esbuild'`.Omit `tsconfig` or provide a valid path.
Install esbuild: `npm install --save-dev esbuild`.
Set `typescript: false` in `svelte-preprocess` options.
Use `const { typescript } = require('svelte-preprocess-esbuild')` or `import { typescript } from 'svelte-preprocess-esbuild'`.Use `typescript` function instead for define replacements.