Permalink
Browse files

use uglify, nodeunit and nodelint directly from node_modules

  • Loading branch information...
1 parent 1ae1775 commit ef0ed4d756ca36e8015b6c7a9c67e064eae6f699 @caolan committed Feb 27, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 Makefile
View
@@ -1,25 +1,25 @@
PACKAGE = asyncjs
NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node)
CWD := $(shell pwd)
-WITH_NODEUNIT = PATH=$(CWD)/node_modules/nodeunit/bin:$(PATH)
-WITH_UGLIFY = PATH=$(CWD)/node_modules/uglify-js/bin:$(PATH)
-WITH_NODELINT = PATH=$(CWD)/node_modules/nodelint/bin:$(PATH)
+NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit
+UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs
+NODELINT = $(CWD)/node_modules/nodelint/nodelint
BUILDDIR = dist
all: clean test build
build: $(wildcard lib/*.js)
mkdir -p $(BUILDDIR)
- $(WITH_UGLIFY) uglifyjs lib/async.js > $(BUILDDIR)/async.min.js
+ $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js
test:
- $(WITH_NODEUNIT) nodeunit test
+ $(NODEUNIT) test
clean:
rm -rf $(BUILDDIR)
lint:
- $(WITH_NODELINT) nodelint --config nodelint.cfg lib/async.js
+ $(NODELINT) --config nodelint.cfg lib/async.js
.PHONY: test build all

3 comments on commit ef0ed4d

Contributor
vvo commented on ef0ed4d Feb 27, 2012

This fails if we already have uglify-js as a dependency in package.json :

{
  "name": "test",
  "description": "will fail",
  "version": "0.0.1",
  "dependencies": {
    "uglify-js" : "1.2.x",
    "async": "0.1.x"
  },
  "engines": { "node": "0.6.8" }
}

npm install will fail :

node_modules/async/node_modules/uglify-js/bin/uglifyjs: not found

.16 works ok

we ran into the same thing as well, sticking with .16 for now /cc @lackac

Owner

I removed the npm scripts causing this problem in .18, please upgrade

Please sign in to comment.