diff --git a/.gitignore b/.gitignore index 3c3629e..4f68017 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +public-min diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5133a7a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Put all 'bin' dirs beneath node_modules into $PATH so that we're using +# the locally installed AssetGraph: +# Ugly 'subst' hack: Check the Make Manual section 8.1 - Function Call Syntax +NPM_BINS := $(subst bin node,bin:node,$(shell if test -d node_modules; then find node_modules/ -name bin -type d; fi)) +ifneq ($(NPM_BINS),) + PATH := ${NPM_BINS}:${PATH} +endif + +deps := $(shell find public/ -type f -name "*.*") + +public-min: public/index.html $(deps) + buildProduction \ + --root public \ + --outroot public-min \ + $< + +PHONY: clean + +clean: + rm -rf public-min \ No newline at end of file diff --git a/bin/server b/bin/server index 76780d5..2c1d805 100644 --- a/bin/server +++ b/bin/server @@ -3,6 +3,6 @@ var connect = require('connect'), http = require('http'); -var app = connect().use(connect.static('public')); +var app = connect().use(connect.static('public-min')); http.createServer(app).listen(process.env.PORT || 3000); diff --git a/package.json b/package.json index 7ffea07..0c9643b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,9 @@ "dependencies": { "connect": "~2.0.3" }, - "devDependencies": {}, + "devDependencies": { + "assetgraph-builder": "latest" + } "engines": { "node": ">=0.6" }, diff --git a/public/index.html b/public/index.html index 8bcc2e6..6fefbdf 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,6 @@