Skip to content

Commit 1a3fa31

Browse files
djgrantTimer
authored andcommitted
Move utils into scripts folder (for inclusion in ejection)
1 parent d606bcc commit 1a3fa31

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

packages/react-scripts/scripts/eject.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var spawnSync = require('cross-spawn').sync;
1414
var chalk = require('chalk');
1515
var prompt = require('react-dev-utils/prompt');
1616
var paths = require('../config/paths');
17-
var createJestConfig = require('../utils/createJestConfig');
17+
var createJestConfig = require('./utils/createJestConfig');
1818

1919
var green = chalk.green;
2020
var cyan = chalk.cyan;
@@ -48,7 +48,8 @@ prompt(
4848
var folders = [
4949
'config',
5050
'config/jest',
51-
'scripts'
51+
'scripts',
52+
'scripts/utils'
5253
];
5354

5455
// Make shallow array of files paths

packages/react-scripts/scripts/start.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ var prompt = require('react-dev-utils/prompt');
2929
var paths = require('../config/paths');
3030
var config = require('../config/webpack.config.dev');
3131
var devServerConfig = require('../config/webpackDevServer.config');
32-
var createWebpackCompiler = require('../utils/createWebpackCompiler');
33-
var addWebpackMiddleware = require('../utils/addWebpackMiddleware');
32+
var createWebpackCompiler = require('./utils/createWebpackCompiler');
33+
var addWebpackMiddleware = require('./utils/addWebpackMiddleware');
3434

3535
var useYarn = fs.existsSync(paths.yarnLockFile);
3636
var cli = useYarn ? 'yarn' : 'npm';

packages/react-scripts/scripts/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (!process.env.CI && argv.indexOf('--coverage') < 0) {
2828

2929
// @remove-on-eject-begin
3030
// This is not necessary after eject because we embed config into package.json.
31-
const createJestConfig = require('../utils/createJestConfig');
31+
const createJestConfig = require('./utils/createJestConfig');
3232
const path = require('path');
3333
const paths = require('../config/paths');
3434
argv.push('--config', JSON.stringify(createJestConfig(

packages/react-scripts/utils/addWebpackMiddleware.js packages/react-scripts/scripts/utils/addWebpackMiddleware.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
var chalk = require('chalk');
12
var historyApiFallback = require('connect-history-api-fallback');
23
var httpProxyMiddleware = require('http-proxy-middleware');
3-
var paths = require('../config/paths');
4-
var chalk = require('chalk');
4+
var paths = require('../../config/paths');
55

66
module.exports = function addMiddleware(devServer) {
77
// `proxy` lets you to specify a fallback server during development.

packages/react-scripts/utils/createJestConfig.js packages/react-scripts/scripts/utils/createJestConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
const fs = require('fs');
12-
const paths = require('../config/paths');
12+
const paths = require('../../config/paths');
1313

1414
module.exports = (resolve, rootDir, isEjecting) => {
1515
// Use this instead of `paths.testsSetup` to avoid putting

0 commit comments

Comments
 (0)