@@ -26,11 +26,9 @@ function printHostingInstructions(
26
26
printBaseMessage ( buildFolder , publicPathname ) ;
27
27
28
28
printDeployInstructions ( publicUrl , hasDeployScript , useYarn ) ;
29
-
30
29
} else if ( publicPath !== '/' ) {
31
30
// "homepage": "http://mywebsite.com/project"
32
31
printBaseMessage ( buildFolder , publicPath ) ;
33
-
34
32
} else {
35
33
// "homepage": "http://mywebsite.com"
36
34
// or no homepage
@@ -39,40 +37,36 @@ function printHostingInstructions(
39
37
printStaticServerInstructions ( buildFolder , useYarn ) ;
40
38
}
41
39
console . log ( ) ;
40
+ console . log ( 'Find out more about deployment here:' ) ;
41
+ console . log ( ) ;
42
+ console . log ( ` ${ chalk . yellow ( 'http://bit.ly/2vY88Kr' ) } ` ) ;
43
+ console . log ( ) ;
42
44
}
43
45
44
46
function printBaseMessage ( buildFolder , hostingLocation ) {
45
- console . log (
46
- `The project was built assuming it is hosted at ${ chalk . green (
47
- hostingLocation || 'the server root'
48
- ) } .`
49
- ) ;
50
- console . log (
51
- `You can control this with the ${ chalk . green (
52
- 'homepage'
53
- ) } field in your ${ chalk . cyan ( 'package.json' ) } .`
54
- ) ;
55
-
56
- if ( ! hostingLocation ) {
57
- console . log ( 'For example, add this to build it for GitHub Pages:' ) ;
58
- console . log ( ) ;
59
-
60
- console . log (
61
- ` ${ chalk . green ( '"homepage"' ) } ${ chalk . cyan ( ':' ) } ${ chalk . green (
62
- '"http://myname.github.io/myapp"'
63
- ) } ${ chalk . cyan ( ',' ) } `
64
- ) ;
65
- }
47
+ console . log (
48
+ `The project was built assuming it is hosted at ${ chalk . green (
49
+ hostingLocation || 'the server root'
50
+ ) } .`
51
+ ) ;
52
+ console . log (
53
+ `You can control this with the ${ chalk . green (
54
+ 'homepage'
55
+ ) } field in your ${ chalk . cyan ( 'package.json' ) } .`
56
+ ) ;
57
+
58
+ if ( ! hostingLocation ) {
59
+ console . log ( 'For example, add this to build it for GitHub Pages:' ) ;
66
60
console . log ( ) ;
67
61
68
62
console . log (
69
- `The ${ chalk . cyan ( buildFolder ) } folder is ready to be deployed.`
63
+ ` ${ chalk . green ( '"homepage"' ) } ${ chalk . cyan ( ':' ) } ${ chalk . green (
64
+ '"http://myname.github.io/myapp"'
65
+ ) } ${ chalk . cyan ( ',' ) } `
70
66
) ;
71
- console . log ( )
72
- console . log ( 'Find out more about deployment here:' ) ;
73
- console . log ( ) ;
74
- console . log ( ` ${ chalk . yellow ( 'http://bit.ly/2vY88Kr' ) } ` ) ;
75
- console . log ( ) ;
67
+ }
68
+ console . log ( ) ;
69
+ console . log ( `The ${ chalk . cyan ( buildFolder ) } folder is ready to be deployed.` ) ;
76
70
}
77
71
78
72
function printDeployInstructions ( publicUrl , hasDeployScript , useYarn ) {
@@ -88,20 +82,24 @@ function printDeployInstructions(publicUrl, hasDeployScript, useYarn) {
88
82
}
89
83
console . log ( ) ;
90
84
91
- console . log ( `Add the following script in your ${ chalk . cyan (
92
- 'package.json'
93
- ) } .` ) ;
85
+ console . log (
86
+ `Add the following script in your ${ chalk . cyan ( 'package.json' ) } .`
87
+ ) ;
94
88
console . log ( ) ;
95
89
96
90
console . log ( ` ${ chalk . dim ( '// ...' ) } ` ) ;
97
91
console . log ( ` ${ chalk . yellow ( '"scripts"' ) } : {` ) ;
98
92
console . log ( ` ${ chalk . dim ( '// ...' ) } ` ) ;
99
- console . log ( ` ${ chalk . yellow ( '"predeploy"' ) } : ${ chalk . yellow (
100
- '"npm run build",'
101
- ) } `) ;
102
- console . log ( ` ${ chalk . yellow ( '"deploy"' ) } : ${ chalk . yellow (
103
- '"gh-pages -d build"'
104
- ) } `) ;
93
+ console . log (
94
+ ` ${ chalk . yellow ( '"predeploy"' ) } : ${ chalk . yellow (
95
+ '"npm run build",'
96
+ ) } `
97
+ ) ;
98
+ console . log (
99
+ ` ${ chalk . yellow ( '"deploy"' ) } : ${ chalk . yellow (
100
+ '"gh-pages -d build"'
101
+ ) } `
102
+ ) ;
105
103
console . log ( ' }' ) ;
106
104
console . log ( ) ;
107
105
0 commit comments