Permalink
Browse files

fixes for -browserify modules in node_modules/

  • Loading branch information...
1 parent 43bb063 commit a97a3cc661c1806d7cd0a02890893337237d5278 @substack substack committed Jun 24, 2012
Showing with 17 additions and 3 deletions.
  1. +14 −1 lib/wrap.js
  2. +3 −2 package.json
View
@@ -214,9 +214,22 @@ Wrap.prototype.bundle = function () {
fn.call(this, this);
}).bind(this));
+ (function () {
+ // hack to set -browserify module targets
+ var nm = path.resolve(__dirname, '../node_modules') + '/';
+ Object.keys(self.files).forEach(function (file) {
+ if (file.slice(0, nm.length) !== nm) return;
+ var s = file.slice(nm.length);
+ if (!/^[^.\/]+-browserify\//.test(s)) return;
+ self.files[file].target = '/node_modules/' + s;
+ });
+ })();
+
var basedir = (function () {
var required = Object.keys(self.files)
- .filter(function (x) { return !self.files[x].target })
+ .filter(function (x) {
+ return !self.files[x].target;
+ })
;
var entries = Object.keys(self.entries)
.filter(function (x) { return !self.entries[x].target })
View
@@ -1,6 +1,6 @@
{
"name" : "browserify",
- "version" : "1.13.2",
+ "version" : "1.13.3",
"description" : "browser-side require() for js directories and npm modules",
"main" : "index.js",
"bin" : {
@@ -46,7 +46,8 @@
"seq": "0.3.3",
"jquery-browserify" : "*",
"lazy" : "1.0.x",
- "ecstatic" : "~0.1.4"
+ "ecstatic" : "~0.1.4",
+ "mkdirp" : "~0.3.3"
},
"author" : {
"name" : "James Halliday",

0 comments on commit a97a3cc

Please sign in to comment.