Merge pull request #44 from rschamp/feature/start-and-watch

Add watch & start command `npm run dev`
This commit is contained in:
Andrew Sliwinski 2015-10-13 08:54:04 -04:00
commit d369b4cdf9
3 changed files with 17 additions and 4 deletions

View file

@ -29,8 +29,9 @@ watch:
wait wait
stop: stop:
pkill -f "node $(WEBPACK) -d --watch" -pkill -f "$(WEBPACK) -d --watch"
pkill -f "node $(WATCH) make clean && make static ./static" -pkill -f "$(WATCH) make clean && make static ./static"
-pkill -f "$(NODE) ./server/index.js"
start: start:
$(NODE) ./server/index.js $(NODE) ./server/index.js

View file

@ -16,8 +16,19 @@ During development, you can use `npm run watch` to cause any update you make to
npm start npm start
``` ```
or to start and watch at once
```bash
npm run dev
```
Once running, open `http://localhost:8333` in your browser. If you wish to have the server reload automatically, you can install either [nodemon](https://github.com/remy/nodemon) or [forever](https://github.com/foreverjs/forever). Once running, open `http://localhost:8333` in your browser. If you wish to have the server reload automatically, you can install either [nodemon](https://github.com/remy/nodemon) or [forever](https://github.com/foreverjs/forever).
### To stop
```bash
# Stops all `start` and `watch` processes
npm stop
```
#### Configuration #### Configuration
`npm start` and `npm run watch` can be configured with the following environment variables `npm start` and `npm run watch` can be configured with the following environment variables

View file

@ -3,12 +3,13 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Standalone WWW client for Scratch", "description": "Standalone WWW client for Scratch",
"scripts": { "scripts": {
"prestart": "make build",
"start": "make start", "start": "make start",
"stop": "make stop",
"test": "make test", "test": "make test",
"watch": "make watch", "watch": "make watch",
"stop-watch": "make stop-watch",
"build": "make build", "build": "make build",
"prestart": "make build" "dev": "make watch && make start &"
}, },
"repository": { "repository": {
"type": "git", "type": "git",