-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.js
26 lines (19 loc) · 892 Bytes
/
start.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
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
require('react-scripts/config/env');
const patchModule = require('./utils/cache');
const fs = require('fs-extra');
const path = require('path');
const chalk = require('chalk');
const appPath = require('react-scripts/config/paths').appPath;
const webpackMonkeyPath = path.resolve(appPath, 'webpack.monkey.js');
const originalConfigFactory = require('react-scripts/config/webpack.config');
if (fs.existsSync(webpackMonkeyPath)) {
console.log(chalk.yellow('WARNING! You are using modified webpack config!'));
const configPatch = require(webpackMonkeyPath);
patchModule('react-scripts/config/webpack.config', (...args) => {
const webpackConfig = originalConfigFactory(...args);
return configPatch(webpackConfig, true) || webpackConfig;
});
}
require('react-scripts/scripts/start');