Skip to content
Browse files

Added production build with assetgraph-builder

  • Loading branch information...
1 parent 0d553c3 commit cfb3f3038d3e53e18730ec388644b7c0d3a02754 @Munter Munter committed Apr 1, 2012
Showing with 25 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +20 −0 Makefile
  3. +1 −1 bin/server
  4. +3 −1 package.json
View
1 .gitignore
@@ -1 +1,2 @@
node_modules
+public-min
View
20 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
View
2 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);
View
4 package.json
@@ -22,7 +22,9 @@
"dependencies": {
"connect": "~2.0.3"
},
- "devDependencies": {},
+ "devDependencies": {
+ "assetgraph-builder": "latest"
+ }
"engines": {
"node": ">=0.6"
},

0 comments on commit cfb3f30

Please sign in to comment.
Something went wrong with that request. Please try again.