From 00c6c43abd45800ccba27dbf1eba03fff02863cc Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Thu, 26 May 2016 19:02:37 +0200 Subject: [PATCH] Update readme and add auto reload golang server --- .gitignore | 1 + README.md | 32 +++++++++++++++++++++++++++++++- fresh.conf | 3 +++ package.json | 10 +++++----- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 fresh.conf diff --git a/.gitignore b/.gitignore index a904651..c27f732 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ static node_modules +tmp diff --git a/README.md b/README.md index 05b670f..476bd63 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/fresh.conf b/fresh.conf new file mode 100644 index 0000000..6efe03e --- /dev/null +++ b/fresh.conf @@ -0,0 +1,3 @@ +ignored: node_modules,src,static +build_name: dev-build +build_log: dev-build.log diff --git a/package.json b/package.json index 65c6f3b..8e649c1 100644 --- a/package.json +++ b/package.json @@ -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" },