Comparing version 2.3.6 to 2.3.7
@@ -11,7 +11,10 @@ var fs = require('fs'), | ||
if(globalName) { | ||
// newline here is necessary since files may not end with a newline and may end with a comment | ||
result += ('\n' + 'define(%name%, %deps%, (function (global) {\n' + | ||
' return function () {\n') | ||
.replace(/%name%/g, JSON.stringify(name)) | ||
.replace(/%deps%/g, JSON.stringify(deps)); | ||
// the content is bundled within the define callback so that it is executed with AMD semantics | ||
result += content; | ||
// newline here is necessary since files may not end with a newline and may end with a comment | ||
result += '\n' + template.replace('%name%', JSON.stringify(name)) | ||
.replace('%deps%', JSON.stringify(deps)) | ||
.replace('%global%', globalName); | ||
result += template.replace('%global%', globalName); | ||
} else { | ||
@@ -18,0 +21,0 @@ // the r.js optimizer does a bunch of source transformations which are |
@@ -100,3 +100,3 @@ var fs = require('fs'), | ||
// pluck the main file for the first package | ||
packageRootFileName = list.packages[0].main; | ||
packageRootFileName = list.packages[0].main || options.main; | ||
@@ -103,0 +103,0 @@ if(typeof packageRootFileName === 'undefined') { |
@@ -1,3 +0,1 @@ | ||
define(%name%, %deps%, (function (global) { | ||
return function () { | ||
var ret, fn; | ||
@@ -4,0 +2,0 @@ return ret || global.%global%; |
}(function(a,b,c) { | ||
var args = arguments, hasName = args.length == 3; | ||
return define(hasName ? a : %name%, (hasName && a != %name% ? b : %deps%), args[args.length - 1]); | ||
var args = arguments; | ||
return define(args.length == 3 ? a : %name%, (b && b instanceof Array ? b : %deps%), args[args.length - 1]); | ||
})); |
{ | ||
"name": "gluejs", | ||
"description": "Build CommonJS modules for the browser via a chainable API", | ||
"version": "2.3.6", | ||
"version": "2.3.7", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Mikito Takada", |
357570
2232