Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
7b881f12
Commit
7b881f12
authored
7 years ago
by
Ade Viankakrisna Fadlil
Committed by
Dan Abramov
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
move the link for deployment to the bottom (#3736)
parent
7fd37d35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-dev-utils/printHostingInstructions.js
+36
-38
packages/react-dev-utils/printHostingInstructions.js
with
36 additions
and
38 deletions
+36
-38
packages/react-dev-utils/printHostingInstructions.js
+
36
-
38
View file @
7b881f12
...
@@ -26,11 +26,9 @@ function printHostingInstructions(
...
@@ -26,11 +26,9 @@ function printHostingInstructions(
printBaseMessage
(
buildFolder
,
publicPathname
);
printBaseMessage
(
buildFolder
,
publicPathname
);
printDeployInstructions
(
publicUrl
,
hasDeployScript
,
useYarn
);
printDeployInstructions
(
publicUrl
,
hasDeployScript
,
useYarn
);
}
else
if
(
publicPath
!==
'
/
'
)
{
}
else
if
(
publicPath
!==
'
/
'
)
{
// "homepage": "http://mywebsite.com/project"
// "homepage": "http://mywebsite.com/project"
printBaseMessage
(
buildFolder
,
publicPath
);
printBaseMessage
(
buildFolder
,
publicPath
);
}
else
{
}
else
{
// "homepage": "http://mywebsite.com"
// "homepage": "http://mywebsite.com"
// or no homepage
// or no homepage
...
@@ -39,40 +37,36 @@ function printHostingInstructions(
...
@@ -39,40 +37,36 @@ function printHostingInstructions(
printStaticServerInstructions
(
buildFolder
,
useYarn
);
printStaticServerInstructions
(
buildFolder
,
useYarn
);
}
}
console
.
log
();
console
.
log
();
console
.
log
(
'
Find out more about deployment here:
'
);
console
.
log
();
console
.
log
(
`
${
chalk
.
yellow
(
'
http://bit.ly/2vY88Kr
'
)}
`
);
console
.
log
();
}
}
function
printBaseMessage
(
buildFolder
,
hostingLocation
)
{
function
printBaseMessage
(
buildFolder
,
hostingLocation
)
{
console
.
log
(
console
.
log
(
`The project was built assuming it is hosted at
${
chalk
.
green
(
`The project was built assuming it is hosted at
${
chalk
.
green
(
hostingLocation
||
'
the server root
'
hostingLocation
||
'
the server root
'
)}
.`
)}
.`
);
);
console
.
log
(
console
.
log
(
`You can control this with the
${
chalk
.
green
(
`You can control this with the
${
chalk
.
green
(
'
homepage
'
'
homepage
'
)}
field in your
${
chalk
.
cyan
(
'
package.json
'
)}
.`
)}
field in your
${
chalk
.
cyan
(
'
package.json
'
)}
.`
);
);
if
(
!
hostingLocation
)
{
if
(
!
hostingLocation
)
{
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
(
`
${
chalk
.
green
(
'
"homepage"
'
)}
${
chalk
.
cyan
(
'
:
'
)}
${
chalk
.
green
(
'
"http://myname.github.io/myapp"
'
)}${
chalk
.
cyan
(
'
,
'
)}
`
);
}
console
.
log
();
console
.
log
();
console
.
log
(
console
.
log
(
`The
${
chalk
.
cyan
(
buildFolder
)}
folder is ready to be deployed.`
`
${
chalk
.
green
(
'
"homepage"
'
)}
${
chalk
.
cyan
(
'
:
'
)}
${
chalk
.
green
(
'
"http://myname.github.io/myapp"
'
)}${
chalk
.
cyan
(
'
,
'
)}
`
);
);
console
.
log
()
}
console
.
log
(
'
Find out more about deployment here:
'
);
console
.
log
();
console
.
log
();
console
.
log
(
`The
${
chalk
.
cyan
(
buildFolder
)}
folder is ready to be deployed.`
);
console
.
log
(
`
${
chalk
.
yellow
(
'
http://bit.ly/2vY88Kr
'
)}
`
);
console
.
log
();
}
}
function
printDeployInstructions
(
publicUrl
,
hasDeployScript
,
useYarn
)
{
function
printDeployInstructions
(
publicUrl
,
hasDeployScript
,
useYarn
)
{
...
@@ -88,20 +82,24 @@ function printDeployInstructions(publicUrl, hasDeployScript, useYarn) {
...
@@ -88,20 +82,24 @@ function printDeployInstructions(publicUrl, hasDeployScript, useYarn) {
}
}
console
.
log
();
console
.
log
();
console
.
log
(
`Add the following script in your
${
chalk
.
cyan
(
console
.
log
(
'
package.json
'
`Add the following script in your
${
chalk
.
cyan
(
'
package.json
'
)}
.`
)}
.`
);
);
console
.
log
();
console
.
log
();
console
.
log
(
`
${
chalk
.
dim
(
'
// ...
'
)}
`
);
console
.
log
(
`
${
chalk
.
dim
(
'
// ...
'
)}
`
);
console
.
log
(
`
${
chalk
.
yellow
(
'
"scripts"
'
)}
: {`
);
console
.
log
(
`
${
chalk
.
yellow
(
'
"scripts"
'
)}
: {`
);
console
.
log
(
`
${
chalk
.
dim
(
'
// ...
'
)}
`
);
console
.
log
(
`
${
chalk
.
dim
(
'
// ...
'
)}
`
);
console
.
log
(
`
${
chalk
.
yellow
(
'
"predeploy"
'
)}
:
${
chalk
.
yellow
(
console
.
log
(
'
"npm run build",
'
`
${
chalk
.
yellow
(
'
"predeploy"
'
)}
:
${
chalk
.
yellow
(
)}
`
);
'
"npm run build",
'
console
.
log
(
`
${
chalk
.
yellow
(
'
"deploy"
'
)}
:
${
chalk
.
yellow
(
)}
`
'
"gh-pages -d build"
'
);
)}
`
);
console
.
log
(
`
${
chalk
.
yellow
(
'
"deploy"
'
)}
:
${
chalk
.
yellow
(
'
"gh-pages -d build"
'
)}
`
);
console
.
log
(
'
}
'
);
console
.
log
(
'
}
'
);
console
.
log
();
console
.
log
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment