Comparing version
14
index.js
@@ -85,3 +85,7 @@ /** | ||
var reqs = createRequires(ids, vars); | ||
tast = createProgram([reqs].concat(factory.body.body)); | ||
if (reqs) { | ||
tast = createProgram([reqs].concat(factory.body.body)); | ||
} else { | ||
tast = createProgram(factory.body.body); | ||
} | ||
this.break(); | ||
@@ -95,3 +99,7 @@ } else if (node.arguments.length == 3 && node.arguments[0].type == 'Literal' && node.arguments[1].type == 'ArrayExpression' && node.arguments[2].type == 'FunctionExpression') { | ||
var reqs = createRequires(ids, vars); | ||
tast = createProgram([reqs].concat(factory.body.body)); | ||
if (reqs) { | ||
tast = createProgram([reqs].concat(factory.body.body)); | ||
} else { | ||
tast = createProgram(factory.body.body); | ||
} | ||
this.break(); | ||
@@ -160,2 +168,4 @@ } | ||
if (decls.length == 0) { return null; } | ||
return { type: 'VariableDeclaration', | ||
@@ -162,0 +172,0 @@ declarations: decls, |
{ | ||
"name": "deamdify", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Browserify transform that converts AMD to CommonJS.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
9381
3.04%157
6.08%