1.0.2 • Published 3 years ago

esbuild-plugin-ts-checker v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

esbuild-plugin-ts-checker

A plugin for esbuild that runs TypeScript in a worker thread.

The plugin works both when building and in watch mode. The only difference is that in watch mode type errors are only printed to the console, so the build won't fail.

Usage

Install esbuild and the plugin

npm install -D esbuild
npm install -D esbuild-plugin-ts-checker

Set up a build script

import { build } from 'esbuild';
import { esbuildTsChecker } from 'esbuild-plugin-ts-checker';

await build({
	entryPoints: [
		//
	],
	outdir: 'dist',
	platform: 'node',
	target: 'node14',
	bundle: true,
	sourcemap: 'external',
	watch: true,
	plugins: [esbuildTsChecker()],
});

Run your builder.

Watch mode screenshot

Screenshot


Options

NameTypeDefault valueDescription
cwdstringprocess.cwd()Working directory
tsconfigstringesbuildConfig.tsconfigThe path and filename of tsconfig.json
watchbooleanesbuildConfig.watchRuns type checking in watch mode.
enableBuildbooleantrueWhether to enable type checking at build when not in watch mode.
failOnErrorbooleantrueWhether to exit with exit code 1 if type checking returns errors at build.

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago