mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-15 18:08:15 +08:00
Merge pull request #115 from nicolaserny/master
Update tsconfig to support dynamic import
This commit is contained in:
2
packages/react-scripts/config/paths.js
vendored
2
packages/react-scripts/config/paths.js
vendored
@@ -82,6 +82,7 @@ module.exports = {
|
||||
testsSetup: resolveApp('src/setupTests.ts'),
|
||||
appNodeModules: resolveApp('node_modules'),
|
||||
appTsConfig: resolveApp('tsconfig.json'),
|
||||
appTsTestConfig: resolveApp('tsconfig.test.json'),
|
||||
publicUrl: getPublicUrl(resolveApp('package.json')),
|
||||
servedPath: getServedPath(resolveApp('package.json')),
|
||||
// These properties only exist before ejecting:
|
||||
@@ -112,6 +113,7 @@ if (
|
||||
testsSetup: resolveOwn('template/src/setupTests.ts'),
|
||||
appNodeModules: resolveOwn('node_modules'),
|
||||
appTsConfig: resolveOwn('template/tsconfig.json'),
|
||||
appTsTestConfig: resolveOwn('template/tsconfig.test.json'),
|
||||
publicUrl: getPublicUrl(resolveOwn('package.json')),
|
||||
servedPath: getServedPath(resolveOwn('package.json')),
|
||||
// These properties only exist before ejecting:
|
||||
|
||||
@@ -47,7 +47,7 @@ module.exports = (resolve, rootDir) => {
|
||||
},
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsConfigFile: paths.appTsConfig,
|
||||
tsConfigFile: paths.appTsTestConfig,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "build/dist",
|
||||
"module": "commonjs",
|
||||
"module": "esnext",
|
||||
"target": "es5",
|
||||
"lib": ["es6", "dom"],
|
||||
"sourceMap": true,
|
||||
|
||||
6
packages/react-scripts/template/tsconfig.test.json
Normal file
6
packages/react-scripts/template/tsconfig.test.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user