Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
39a5b4de
Commit
39a5b4de
authored
8 years ago
by
Jirat Ki
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Skip gh-page setup instruction if scripts.deploy has been added (#1222)
parent
f44ae25f
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/scripts/build.js
+20
-16
packages/react-scripts/scripts/build.js
with
20 additions
and
16 deletions
+20
-16
packages/react-scripts/scripts/build.js
+
20
-
16
View file @
39a5b4de
...
...
@@ -158,7 +158,8 @@ function build(previousSizeMap) {
console
.
log
();
var
openCommand
=
process
.
platform
===
'
win32
'
?
'
start
'
:
'
open
'
;
var
homepagePath
=
require
(
paths
.
appPackageJson
).
homepage
;
var
appPackage
=
require
(
paths
.
appPackageJson
);
var
homepagePath
=
appPackage
.
homepage
;
var
publicPath
=
config
.
output
.
publicPath
;
if
(
homepagePath
&&
homepagePath
.
indexOf
(
'
.github.io/
'
)
!==
-
1
)
{
// "homepage": "http://user.github.io/project"
...
...
@@ -167,23 +168,26 @@ function build(previousSizeMap) {
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
();
if
(
useYarn
)
{
console
.
log
(
'
'
+
chalk
.
cyan
(
'
yarn
'
)
+
'
add --dev gh-pages
'
);
}
else
{
console
.
log
(
'
'
+
chalk
.
cyan
(
'
npm
'
)
+
'
install --save-dev gh-pages
'
);
// If script deploy has been added to package.json, skip the instructions
if
(
typeof
appPackage
.
scripts
.
deploy
===
'
undefined
'
)
{
console
.
log
();
if
(
useYarn
)
{
console
.
log
(
'
'
+
chalk
.
cyan
(
'
yarn
'
)
+
'
add --dev gh-pages
'
);
}
else
{
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
(
'
"npm run build&&gh-pages -d build"
'
));
console
.
log
(
'
}
'
);
console
.
log
();
console
.
log
(
'
Then run:
'
);
}
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
(
'
"npm run build&&gh-pages -d build"
'
));
console
.
log
(
'
}
'
);
console
.
log
();
console
.
log
(
'
Then run:
'
);
console
.
log
();
console
.
log
(
'
'
+
chalk
.
cyan
(
useYarn
?
'
yarn
'
:
'
npm
'
)
+
'
run deploy
'
);
console
.
log
();
}
else
if
(
publicPath
!==
'
/
'
)
{
...
...
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
Menu
Explore
Projects
Groups
Snippets