forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
35 lines (31 loc) · 927 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
const {
pushExtensions,
pushExclusiveLoader,
} = require('react-dev-utils/plugins');
function apply(config, { path, paths }) {
pushExtensions({ config }, [['.js', '.tsx', '.ts']]);
pushExclusiveLoader({ config }, '/\\.(js|jsx)$/', {
// Process TypeScript with `at-loader`
test: /\.(ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve('awesome-typescript-loader'),
options: {
silent: true,
forceConsistentCasingInFileNames: true,
module: 'esnext',
moduleResolution: 'node',
downlevelIteration: true,
sourceMap: true,
target: 'es5',
// @remove-on-eject-begin
configFileName: path.join(paths.appSrc, 'tsconfig.json'),
// @remove-on-eject-end
},
});
return config;
}
function eject() {
// TODO: remove defaults above and inject into their file
}
module.exports = { apply, eject, tsc: require('typescript') };