Skip to content

Commit

Permalink
Use esnext target with TypeScript and scope hoist (#1781)
Browse files Browse the repository at this point in the history
Should bring a noticeable size improvement on big TypeScript apps
  • Loading branch information
fathyb authored and DeMoorJasper committed Jul 23, 2018
1 parent cfab887 commit 6d4f4e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/parcel/src/assets/TypeScriptAsset.js
Expand Up @@ -12,7 +12,9 @@ class TypeScriptAsset extends Asset {
let typescript = await localRequire('typescript', this.name);
let transpilerOptions = {
compilerOptions: {
module: typescript.ModuleKind.CommonJS,
module: this.options.scopeHoist
? typescript.ModuleKind.ESNext
: typescript.ModuleKind.CommonJS,
jsx: typescript.JsxEmit.Preserve,

// it brings the generated output from TypeScript closer to that generated by Babel
Expand Down

0 comments on commit 6d4f4e8

Please sign in to comment.