TypeScript support -- disabled by default

This commit is contained in:
Michael Bradley, Jr 2018-10-01 19:19:55 -05:00 committed by Pascal Precht
parent 8c6b26f311
commit 4aedeeee9b
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 15 additions and 0 deletions

View File

@ -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 // development config
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------