Commit cd8bae0d authored by Dan Abramov's avatar Dan Abramov
Browse files

Further tweak the build output

parent 670e382c
1 merge request!353Add check-filename-webpack-plugin to warn on JSX file extension
Showing with 17 additions and 10 deletions
+17 -10
...@@ -118,7 +118,11 @@ function build(previousSizeMap) { ...@@ -118,7 +118,11 @@ function build(previousSizeMap) {
var publicPath = config.output.publicPath; var publicPath = config.output.publicPath;
if (homepagePath && homepagePath.indexOf('.github.io/') !== -1) { if (homepagePath && homepagePath.indexOf('.github.io/') !== -1) {
// "homepage": "http://user.github.io/project" // "homepage": "http://user.github.io/project"
console.log('You can now deploy them to ' + chalk.green(homepagePath) + ':'); console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
console.log();
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();
console.log(' ' + chalk.blue('git') + chalk.cyan(' commit -am ') + chalk.yellow('"Save local changes"')); console.log(' ' + chalk.blue('git') + chalk.cyan(' commit -am ') + chalk.yellow('"Save local changes"'));
console.log(' ' + chalk.blue('git') + chalk.cyan(' checkout -B gh-pages')); console.log(' ' + chalk.blue('git') + chalk.cyan(' checkout -B gh-pages'));
...@@ -128,32 +132,35 @@ function build(previousSizeMap) { ...@@ -128,32 +132,35 @@ function build(previousSizeMap) {
console.log(' ' + chalk.blue('git') + chalk.cyan(' push -f origin gh-pages')); console.log(' ' + chalk.blue('git') + chalk.cyan(' push -f origin gh-pages'));
console.log(' ' + chalk.blue('git') + chalk.cyan(' checkout -')); console.log(' ' + chalk.blue('git') + chalk.cyan(' checkout -'));
console.log(); console.log();
console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
} else if (publicPath !== '/') { } else if (publicPath !== '/') {
// "homepage": "http://mywebsite.com/project" // "homepage": "http://mywebsite.com/project"
console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.'); console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.'); console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
} else {
// no homepage or "homepage": "http://mywebsite.com"
console.log('You can now deploy them or serve them with a static server:');
console.log(); console.log();
console.log(' ' + chalk.blue('npm') + chalk.cyan(' install -g pushstate-server')); console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
console.log(' ' + chalk.blue('pushstate-server') + chalk.cyan(' build'));
console.log(' ' + chalk.blue(openCommand) + chalk.cyan(' http://localhost:9000'));
console.log(); console.log();
} else {
// no homepage or "homepage": "http://mywebsite.com"
console.log('The project was built assuming it is hosted at the server root.'); console.log('The project was built assuming it is hosted at the server root.');
if (homepagePath) { if (homepagePath) {
// "homepage": "http://mywebsite.com" // "homepage": "http://mywebsite.com"
console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.'); console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');
console.log();
} else { } else {
// no homepage // no homepage
console.log('To override this, specify the ' + chalk.green('homepage') + ' in your ' + chalk.cyan('package.json') + '.'); console.log('To override this, specify the ' + chalk.green('homepage') + ' in your ' + chalk.cyan('package.json') + '.');
console.log('For example, add this to build it for GitHub Pages:') console.log('For example, add this to build it for GitHub Pages:')
console.log(); console.log();
console.log(' ' + chalk.green('"homepage"') + chalk.cyan(': ') + chalk.green('"http://myname.github.io/myapp"') + chalk.cyan(',')); console.log(' ' + chalk.green('"homepage"') + chalk.cyan(': ') + chalk.green('"http://myname.github.io/myapp"') + chalk.cyan(','));
console.log();
} }
console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');
console.log('You may also serve it locally with a static server:')
console.log();
console.log(' ' + chalk.blue('npm') + chalk.cyan(' install -g pushstate-server'));
console.log(' ' + chalk.blue('pushstate-server') + chalk.cyan(' build'));
console.log(' ' + chalk.blue(openCommand) + chalk.cyan(' http://localhost:9000'));
console.log();
} }
console.log();
}); });
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment