From 60533bc2887c49e55d3afeb25ba19420ec857386 Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Tue, 30 Oct 2018 11:48:37 +0100 Subject: [PATCH] Enable TS in CRA (#1239) --- .../app/src/sandbox/eval/presets/create-react-app/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/sandbox/eval/presets/create-react-app/index.js b/packages/app/src/sandbox/eval/presets/create-react-app/index.js index 54140505153..0e8077927d7 100644 --- a/packages/app/src/sandbox/eval/presets/create-react-app/index.js +++ b/packages/app/src/sandbox/eval/presets/create-react-app/index.js @@ -27,7 +27,7 @@ export default function initialize() { let v2Initialized = false; const preset = new Preset( 'create-react-app', - ['web.js', 'js', 'json', 'web.jsx', 'jsx'], + ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'ts', 'tsx'], { 'react-native': 'react-native-web' }, { hasDotEnv: true, @@ -73,11 +73,12 @@ export default function initialize() { }, ], 'react', + 'typescript', ], }, }; preset.registerTranspiler( - module => /\.jsx?$/.test(module.path), + module => /\.(t|j)sx?$/.test(module.path), [ { transpiler: babelTranspiler,