Merge branch 'rerun' into 'master'

Update readme and add auto reload golang server



See merge request !5
This commit is contained in:
Nicolas Duhamel 2016-05-26 16:56:47 +00:00
commit fb4dcdc8fd
4 changed files with 40 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
static
node_modules
tmp

View File

@ -25,15 +25,45 @@ make test
make clean
```
## Debian user
If you use debian the node binary is named nodejs you have to symlink it to node:
```
# ln -s /usr/bin/nodejs /usr/bin/node
```
## Build
Install npm depedencies
```
npm install
```
Then run build
```
npm run build
```
## Watch
## Watch js and less update
```
npm run watch
```
## Auto reload web server
First install fresh
```
go get github.com/pilu/fresh
```
Then run it
```
fresh -c fresh.conf
```

3
fresh.conf Normal file
View File

@ -0,0 +1,3 @@
ignored: node_modules,src,static
build_name: dev-build
build_log: dev-build.log

View File

@ -4,11 +4,11 @@
"description": "``` make dev ```",
"main": "index.js",
"scripts": {
"build-js": "mkdir -p ./static/js & nodejs node_modules/.bin/browserify src/js/app.js -o static/js/app.js",
"build-less": "mkdir -p ./static/css & nodejs ./node_modules/.bin/lessc --include-path=./node_modules src/less/app.less static/css/app.css",
"build-font": "mkdir ./static & nodejs ./node_modules/.bin/fontify",
"watch-js": "nodejs ./node_modules/.bin/nodemon -e js -w src/js/app.js -x 'npm run build-js'",
"watch-less": "nodejs ./node_modules/.bin/nodemon -e less -w src/less/app.less -x 'npm run build-less'",
"build-js": "mkdir -p ./static/js & node node_modules/.bin/browserify src/js/app.js -o static/js/app.js",
"build-less": "mkdir -p ./static/css & node ./node_modules/.bin/lessc --include-path=./node_modules src/less/app.less static/css/app.css",
"build-font": "mkdir ./static & node ./node_modules/.bin/fontify",
"watch-js": "node ./node_modules/.bin/nodemon -e js -w src/js/app.js -x 'npm run build-js'",
"watch-less": "node ./node_modules/.bin/nodemon -e less -w src/less/app.less -x 'npm run build-less'",
"build": "npm run build-js & npm run build-less & npm run build-font",
"watch": "npm run watch-js & npm run watch-less"
},