Skip to content

Commit 1b6f58c

Browse files
shubhekshagaearon
authored andcommitted
Forked react-scripts should retain the binary name (facebook#754)
* Forked react-scripts should retain the binary name * Forked react-scripts should retain the binary name -- fixed issue with regex * Forked react-scripts should retain the binary name -- fixed style nit
1 parent e0dfa30 commit 1b6f58c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/react-scripts/scripts/eject.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ prompt(
9494
delete appPackage.scripts['eject'];
9595
Object.keys(appPackage.scripts).forEach(function (key) {
9696
appPackage.scripts[key] = appPackage.scripts[key]
97-
.replace(
98-
new RegExp(ownPackageName + ' (\\w+)', 'g'),
99-
'node scripts/$1.js'
100-
);
97+
.replace(/react-scripts (\w+)/g, 'node scripts/$1.js');
10198
});
10299

103100
// Add Jest config

packages/react-scripts/scripts/init.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
2424

2525
// Setup the script rules
2626
appPackage.scripts = {
27-
'start': ownPackageName + ' start',
28-
'build': ownPackageName + ' build',
29-
'test': ownPackageName + ' test --env=jsdom',
30-
'eject': ownPackageName + ' eject'
27+
'start': 'react-scripts start',
28+
'build': 'react-scripts build',
29+
'test': 'react-scripts test --env=jsdom',
30+
'eject': 'react-scripts eject'
3131
};
3232

3333
fs.writeFileSync(

0 commit comments

Comments
 (0)