Commit 4d7b7544 authored by Paul O’Shannessy's avatar Paul O’Shannessy Committed by Ville Immonen
Browse files

Use npm script hooks to avoid && in deploy script (#1324)

parent a90e2b2e
No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
...@@ -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:');
......
...@@ -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 scripts 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`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment