mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +08:00
Update instructions on publishing to GitHub pages (#841)
* Update instructions on publishing to GitHub pages * Update README formatting
This commit is contained in:
committed by
Ville Immonen
parent
4feff2acf7
commit
feb6036fb2
20
packages/react-scripts/scripts/build.js
vendored
20
packages/react-scripts/scripts/build.js
vendored
@@ -147,13 +147,19 @@ function build(previousSizeMap) {
|
||||
console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
|
||||
console.log('To publish it at ' + chalk.green(homepagePath) + ', run:');
|
||||
console.log();
|
||||
console.log(' ' + chalk.cyan('git') + ' commit -am ' + chalk.yellow('"Save local changes"'));
|
||||
console.log(' ' + chalk.cyan('git') + ' checkout -B gh-pages');
|
||||
console.log(' ' + chalk.cyan('git') + ' add -f build');
|
||||
console.log(' ' + chalk.cyan('git') + ' commit -am ' + chalk.yellow('"Rebuild website"'));
|
||||
console.log(' ' + chalk.cyan('git') + ' filter-branch -f --prune-empty --subdirectory-filter build');
|
||||
console.log(' ' + chalk.cyan('git') + ' push -f origin gh-pages');
|
||||
console.log(' ' + chalk.cyan('git') + ' checkout -');
|
||||
console.log(' ' + chalk.cyan('npm') + ' install --save-dev gh-pages');
|
||||
console.log();
|
||||
console.log('Add the following script in your ' + chalk.cyan('package.json') + '.');
|
||||
console.log();
|
||||
console.log(' ' + chalk.dim('// ...'));
|
||||
console.log(' ' + chalk.yellow('"scripts"') + ': {');
|
||||
console.log(' ' + chalk.dim('// ...'));
|
||||
console.log(' ' + chalk.yellow('"deploy"') + ': ' + chalk.yellow('"gh-pages -d build"'));
|
||||
console.log(' }');
|
||||
console.log();
|
||||
console.log('Then run:');
|
||||
console.log();
|
||||
console.log(' ' + chalk.cyan('npm') + ' run deploy');
|
||||
console.log();
|
||||
} else if (publicPath !== '/') {
|
||||
// "homepage": "http://mywebsite.com/project"
|
||||
|
||||
Reference in New Issue
Block a user