mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-17 02:51:08 +08:00
6
packages/react-scripts/config/paths.js
vendored
6
packages/react-scripts/config/paths.js
vendored
@@ -58,7 +58,7 @@ module.exports = {
|
||||
appPackageJson: resolveApp('package.json'),
|
||||
appSrc: resolveApp('src'),
|
||||
yarnLockFile: resolveApp('yarn.lock'),
|
||||
testsSetup: resolveApp('src/setupTests.js'),
|
||||
testsSetup: resolveApp('src/setupTests.ts'),
|
||||
appNodeModules: resolveApp('node_modules'),
|
||||
publicUrl: getPublicUrl(resolveApp('package.json')),
|
||||
servedPath: getServedPath(resolveApp('package.json')),
|
||||
@@ -78,7 +78,7 @@ module.exports = {
|
||||
appPackageJson: resolveApp('package.json'),
|
||||
appSrc: resolveApp('src'),
|
||||
yarnLockFile: resolveApp('yarn.lock'),
|
||||
testsSetup: resolveApp('src/setupTests.js'),
|
||||
testsSetup: resolveApp('src/setupTests.ts'),
|
||||
appNodeModules: resolveApp('node_modules'),
|
||||
publicUrl: getPublicUrl(resolveApp('package.json')),
|
||||
servedPath: getServedPath(resolveApp('package.json')),
|
||||
@@ -107,7 +107,7 @@ if (
|
||||
appPackageJson: resolveOwn('package.json'),
|
||||
appSrc: resolveOwn('template/src'),
|
||||
yarnLockFile: resolveOwn('template/yarn.lock'),
|
||||
testsSetup: resolveOwn('template/src/setupTests.js'),
|
||||
testsSetup: resolveOwn('template/src/setupTests.ts'),
|
||||
appNodeModules: resolveOwn('node_modules'),
|
||||
publicUrl: getPublicUrl(resolveOwn('package.json')),
|
||||
servedPath: getServedPath(resolveOwn('package.json')),
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = (resolve, rootDir) => {
|
||||
// Use this instead of `paths.testsSetup` to avoid putting
|
||||
// an absolute filename into configuration after ejecting.
|
||||
const setupTestsFile = fs.existsSync(paths.testsSetup)
|
||||
? '<rootDir>/src/setupTests.js'
|
||||
? '<rootDir>/src/setupTests.ts'
|
||||
: undefined;
|
||||
|
||||
// TODO: I don't know if it's safe or not to just use / as path separator
|
||||
|
||||
Reference in New Issue
Block a user