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
4d7b7544
Commit
4d7b7544
authored
8 years ago
by
Paul O’Shannessy
Committed by
Ville Immonen
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Use npm script hooks to avoid && in deploy script (#1324)
parent
a90e2b2e
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-scripts/scripts/build.js
+2
-1
packages/react-scripts/scripts/build.js
packages/react-scripts/template/README.md
+4
-3
packages/react-scripts/template/README.md
with
6 additions
and
4 deletions
+6
-4
packages/react-scripts/scripts/build.js
+
2
-
1
View file @
4d7b7544
...
@@ -181,7 +181,8 @@ function build(previousSizeMap) {
...
@@ -181,7 +181,8 @@ function build(previousSizeMap) {
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
(
'
"deploy"
'
)
+
'
:
'
+
chalk
.
yellow
(
'
"npm run build&&gh-pages -d build"
'
));
console
.
log
(
'
'
+
chalk
.
yellow
(
'
"predeploy"
'
)
+
'
:
'
+
chalk
.
yellow
(
'
"npm run build",
'
));
console
.
log
(
'
'
+
chalk
.
yellow
(
'
"deploy"
'
)
+
'
:
'
+
chalk
.
yellow
(
'
"gh-pages -d build"
'
));
console
.
log
(
'
}
'
);
console
.
log
(
'
}
'
);
console
.
log
();
console
.
log
();
console
.
log
(
'
Then run:
'
);
console
.
log
(
'
Then run:
'
);
...
...
This diff is collapsed.
Click to expand it.
packages/react-scripts/template/README.md
+
4
-
3
View file @
4d7b7544
...
@@ -1132,17 +1132,18 @@ To publish it at [https://myusername.github.io/my-app](https://myusername.github
...
@@ -1132,17 +1132,18 @@ To publish it at [https://myusername.github.io/my-app](https://myusername.github
npm
install
--save-dev
gh-pages
npm
install
--save-dev
gh-pages
```
```
Add the following script in your
`package.json`
:
Add the following script
s
in your
`package.json`
:
```
js
```
js
// ...
// ...
"
scripts
"
:
{
"
scripts
"
:
{
// ...
// ...
"
deploy
"
:
"
npm run build&&gh-pages -d build
"
"
predeploy
"
:
"
npm run build
"
,
"
deploy
"
:
"
gh-pages -d build
"
}
}
```
```
(Note: the lack of whitespace is intentional.)
The
`predeploy`
script will run automatically before
`deploy`
is run.
#### Step 3: Deploy the site by running `npm run deploy`
#### Step 3: Deploy the site by running `npm run deploy`
...
...
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