Skip to content

Add npm scripts for start, build, lint, etc. - fixes #903 #933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

[Download](https://github.com/google/web-starter-kit/releases/latest) the kit or clone this repository and build on what is included in the `app` directory.

```bash
$ npm install
$ npm start
```

There are two HTML starting points, from which you can choose:

- `index.html` - the default starting point, containing Material Design layout.
Expand Down
8 changes: 4 additions & 4 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ There are many commands available to help you build and test sites. Here are a f
## Watch For Changes & Automatically Refresh Across Devices

```sh
$ gulp serve
$ npm start
```

This outputs an IP address you can use to locally test and another that can be used on devices
Expand All @@ -14,7 +14,7 @@ caching, so your site will stop being available when the web server stops runnin
## Build & Optimize

```sh
$ gulp
$ npm run build
```

Build and optimize the current project, ready for deployment.
Expand All @@ -29,7 +29,7 @@ no network connectivity.
## Serve the Fully Built & Optimized Site

```sh
$ gulp serve:dist
$ npm run serve:dist
```

This outputs an IP address you can use to locally test and another that can be used on devices
Expand All @@ -55,7 +55,7 @@ Using the `sw-precache`-generated output makes it very difficult to quickly test
## Performance Insights

```sh
$ gulp pagespeed
$ npm run pagespeed
```

Runs the deployed (public) version of your site against the [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) API to help you stay on top of where you can improve.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
},
"private": true,
"scripts": {
"test": "gulp && git status | grep 'working directory clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)"
"start": "gulp serve",
"test": "gulp && git status | grep 'working directory clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)",
"build": "gulp",
"lint": "gulp lint",
"serve:dist": "gulp serve:dist",
"pagespeed": "gulp pagespeed"
},
"eslintConfig": {
"extends": "google"
Expand Down