From 4aedeeee9b77daffeae687e2ffdbef6c2afea307 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Mon, 1 Oct 2018 19:19:55 -0500 Subject: [PATCH] TypeScript support -- disabled by default --- lib/pipeline/webpack.config.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/pipeline/webpack.config.js b/lib/pipeline/webpack.config.js index 644eb2ef..fe914d85 100644 --- a/lib/pipeline/webpack.config.js +++ b/lib/pipeline/webpack.config.js @@ -201,6 +201,21 @@ if (isFlowEnabled) { ); } +// TypeScript +// ----------------------------------------------------------------------------- + +// should be false in configs that have isFlowEnabled = true +const isTypeScriptEnabled = false; +if (isTypeScriptEnabled) { + // position @babel/preset-typescript as the last preset (runs first) + // see: https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/ + baseBabelLoader.options.presets.push( + require.resolve('@babel/preset-typescript') + ); + // additional extensions + base.resolve.extensions.push('.ts', '.tsx'); +} + // development config // -----------------------------------------------------------------------------