Parcel: TypeScript files are not type checked 馃悰

Created on 26 Apr 2018  路  2Comments  路  Source: parcel-bundler/parcel

This is a 馃悰 bug report.

馃帥 Configuration (.babelrc, package.json, cli command)

+- tsconfig.json
+- src/
+-- main.ts
+- webview/
+-- tsconfig.json
+-- webview.html
+-- webview.ts

馃 Expected Behavior

Bundling HTML that includes .ts files should fail when the TypeScript files fail compilation due to type checks failing.

馃槸 Current Behavior

Bundled files are not type checked; a bundle is always produced, and no TypeScript errors are presented to the user.

馃拋 Possible Solution

Collect TypeScript compilation failures, print them to the console, and abort bundling.

(My workaround for now is to have a separate TypeScript compiler process running in the background in watch mode, with "noEmit" set to true in tsconfig.json.)

馃敠 Context

Bundling code for use in a mobile WebView and retaining type safety.

馃捇 Code Sample

index.ts:

const myValue: string = 123;

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.7.0
| Node | 8.9.4
| npm/Yarn | 1.3.2
| Operating System | Windows 10

Most helpful comment

For typechecking use this plugin, this is outside the scope of the ts support inside parcel https://github.com/fathyb/parcel-plugin-typescript

All 2 comments

For typechecking use this plugin, this is outside the scope of the ts support inside parcel https://github.com/fathyb/parcel-plugin-typescript

Please note the plugin isn't compatible with Parcel 1.7.1 for now, it should be fixed in the next days.

Was this page helpful?
0 / 5 - 0 ratings