Skip to content

Commit 471a01c

Browse files
CompuIvesSaraVieira
authored andcommitted
Enable TS in CRA (codesandbox#1239)
1 parent 1a971e5 commit 471a01c

File tree

1 file changed

+3
-2
lines changed
  • packages/app/src/sandbox/eval/presets/create-react-app

1 file changed

+3
-2
lines changed

packages/app/src/sandbox/eval/presets/create-react-app/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function initialize() {
2727
let v2Initialized = false;
2828
const preset = new Preset(
2929
'create-react-app',
30-
['web.js', 'js', 'json', 'web.jsx', 'jsx'],
30+
['web.js', 'js', 'json', 'web.jsx', 'jsx', 'ts', 'tsx'],
3131
{ 'react-native': 'react-native-web' },
3232
{
3333
hasDotEnv: true,
@@ -73,11 +73,12 @@ export default function initialize() {
7373
},
7474
],
7575
'react',
76+
'typescript',
7677
],
7778
},
7879
};
7980
preset.registerTranspiler(
80-
module => /\.jsx?$/.test(module.path),
81+
module => /\.(t|j)sx?$/.test(module.path),
8182
[
8283
{
8384
transpiler: babelTranspiler,

0 commit comments

Comments
 (0)