From a58cf8c485043ab383b85e6fec5765bd199cfbc8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 26 May 2015 13:40:02 -0500 Subject: [PATCH] Do not name AMD export 3-argument define call is for AMD builds only and should not be included in a UMD wrapper. Refs chaijs/chai#362. --- lib/builders/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/builders/scripts.js b/lib/builders/scripts.js index 52b0571..697ea81 100644 --- a/lib/builders/scripts.js +++ b/lib/builders/scripts.js @@ -66,7 +66,7 @@ Scripts.umd = function (canonical, alias, js) { + 'if (typeof exports == "object") {\n' + ' module.exports = require("' + canonical + '");\n' + '} else if (typeof define == "function" && define.amd) {\n' - +' define("' + alias + '", [], function(){ return require("' + canonical + '"); });\n' + +' define([], function(){ return require("' + canonical + '"); });\n' + '} else {\n' + ' (this || window)["' + alias + '"] = require("' + canonical + '");\n' + '}\n'