mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Merge pull request #44 from rschamp/feature/start-and-watch
Add watch & start command `npm run dev`
This commit is contained in:
commit
d369b4cdf9
3 changed files with 17 additions and 4 deletions
5
Makefile
5
Makefile
|
@ -29,8 +29,9 @@ watch:
|
|||
wait
|
||||
|
||||
stop:
|
||||
pkill -f "node $(WEBPACK) -d --watch"
|
||||
pkill -f "node $(WATCH) make clean && make static ./static"
|
||||
-pkill -f "$(WEBPACK) -d --watch"
|
||||
-pkill -f "$(WATCH) make clean && make static ./static"
|
||||
-pkill -f "$(NODE) ./server/index.js"
|
||||
|
||||
start:
|
||||
$(NODE) ./server/index.js
|
||||
|
|
11
README.md
11
README.md
|
@ -16,8 +16,19 @@ During development, you can use `npm run watch` to cause any update you make to
|
|||
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).
|
||||
|
||||
### To stop
|
||||
```bash
|
||||
# Stops all `start` and `watch` processes
|
||||
npm stop
|
||||
```
|
||||
|
||||
#### Configuration
|
||||
|
||||
`npm start` and `npm run watch` can be configured with the following environment variables
|
||||
|
|
|
@ -3,12 +3,13 @@
|
|||
"version": "1.0.0",
|
||||
"description": "Standalone WWW client for Scratch",
|
||||
"scripts": {
|
||||
"prestart": "make build",
|
||||
"start": "make start",
|
||||
"stop": "make stop",
|
||||
"test": "make test",
|
||||
"watch": "make watch",
|
||||
"stop-watch": "make stop-watch",
|
||||
"build": "make build",
|
||||
"prestart": "make build"
|
||||
"dev": "make watch && make start &"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in a new issue