Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bin/build-react-app.js

This file was deleted.

2 changes: 0 additions & 2 deletions bin/eject-react-app.js

This file was deleted.

21 changes: 21 additions & 0 deletions bin/react-scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
var path = require('path');
var spawn = require('cross-spawn');
var script = process.argv[2];
var args = process.argv.slice(3);

switch (script) {
case 'build':
case 'start':
case 'eject':
spawn(
'node',
[path.resolve(__dirname, '..', 'scripts', script)].concat(args),
{stdio: 'inherit'}
);
break;
default:
console.log('Unknown script "' + script + '".');
console.log('Perhaps you need to update react-scripts?');
break;
}
2 changes: 0 additions & 2 deletions bin/start-react-app.js

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
"template"
],
"bin": {
"start-react-app": "./bin/start-react-app.js",
"build-react-app": "./bin/build-react-app.js",
"eject-react-app": "./bin/eject-react-app.js"
"react-scripts": "./bin/react-scripts.js"
},
"dependencies": {
"autoprefixer": "6.3.7",
Expand Down
4 changes: 1 addition & 3 deletions scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi

console.log('Ejecting...');
console.log();

var selfPath = path.join(__dirname, '..');
var hostPath = path.join(selfPath, '..', '..');

var files = [
path.join('config', 'babel.dev.js'),
path.join('config', 'babel.prod.js'),
Expand Down Expand Up @@ -73,7 +73,6 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
content = content.replace(/^\/\*\*(\*(?!\/)|[^*])*\*\//, '').trim() + '\n';
fs.writeFileSync(path.join(hostPath, file), content);
});

console.log();

var selfPackage = require(path.join(selfPath, 'package.json'));
Expand Down Expand Up @@ -109,5 +108,4 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
console.log('Please consider sharing why you ejected in this survey:');
console.log(' http://goo.gl/forms/Bi6CZjk1EqsdelXk1');
console.log();

});
5 changes: 2 additions & 3 deletions scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module.exports = function(hostPath, appName, verbose) {
// Setup the script rules
hostPackage.scripts = {};
['start', 'build', 'eject'].forEach(function(command) {
hostPackage.scripts[command] =
command + '-react-app';
hostPackage.scripts[command] = 'react-scripts ' + command;
});

fs.writeFileSync(
Expand All @@ -53,7 +52,7 @@ module.exports = function(hostPath, appName, verbose) {
copySync(
path.join(selfPath, 'template', filename),
path.join(hostPath, filename)
);
);
});

// Run another npm install for react and react-dom
Expand Down