@@ -196,6 +196,7 @@ async function build (args, api, options) {
196
196
}
197
197
198
198
return new Promise ( ( resolve , reject ) => {
199
+ const isFreshBuild = ! fs . existsSync ( api . resolve ( 'node_modules/.cache' ) )
199
200
webpack ( webpackConfig , ( err , stats ) => {
200
201
stopSpinner ( false )
201
202
if ( err ) {
@@ -214,18 +215,21 @@ async function build (args, api, options) {
214
215
log ( formatStats ( stats , targetDirShort , api ) )
215
216
if ( args . target === 'app' && ! isLegacyBuild ) {
216
217
if ( ! args . watch ) {
217
- done ( `Build complete. The ${ chalk . cyan ( targetDirShort ) } directory is ready to be deployed.\n` )
218
+ done ( `Build complete. The ${ chalk . cyan ( targetDirShort ) } directory is ready to be deployed.` )
219
+ info ( `Check out deployment instructions at ${ chalk . cyan ( `https://cli.vuejs.org/guide/deployment.html` ) } \n` )
218
220
} else {
219
221
done ( `Build complete. Watching for changes...` )
220
222
}
221
223
if (
222
224
options . baseUrl === '/' &&
223
225
// only log the tips if this is the first build
224
- ! fs . existsSync ( api . resolve ( 'node_modules/.cache' ) )
226
+ isFreshBuild
225
227
) {
226
- info ( `The app is built assuming that it will be deployed at the root of a domain.` )
227
- info ( `If you intend to deploy it under a subpath, update the ${ chalk . green ( 'baseUrl' ) } option` )
228
- info ( `in your project config (${ chalk . cyan ( `vue.config.js` ) } or ${ chalk . green ( '"vue"' ) } field in ${ chalk . cyan ( `package.json` ) } ).\n` )
228
+ console . log (
229
+ chalk . gray ( `Tip: the direcotry is meant to be served by an HTTP server, and will not work if\n` +
230
+ `you open it directly over file:// protocol. To preview it locally, use an HTTP\n` +
231
+ `server like the ${ chalk . yellow ( `serve` ) } package on npm.\n` )
232
+ )
229
233
}
230
234
}
231
235
}
0 commit comments