diff --git a/lib/pipeline/webpack.config.js b/lib/pipeline/webpack.config.js index 644eb2ef8..fe914d85a 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 // -----------------------------------------------------------------------------