From ad8296a5358357770b9e9a25b5f9e0576a6059fc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 22 Aug 2013 09:22:31 -0700 Subject: [PATCH] Correct `exportsOptions` in build.js. Former-commit-id: 35c8977e27bea40431392e02c300625ce6459cca --- build.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build.js b/build.js index d42636c8b..41f2477f5 100644 --- a/build.js +++ b/build.js @@ -2669,13 +2669,11 @@ var exportsOptions = (function() { var result = options.reduce(function(result, value) { return /^exports=.*$/.test(value) ? optionToArray(value).sort() : result; - }, isUnderscore - ? ['commonjs', 'global', 'node'] - : allExports.slice() + }, isModularize + ? [] + : (isUnderscore ? ['commonjs', 'global', 'node'] : _.without(allExports, 'npm')) ); - return isModularize - ? _.first(result, 1) - : _.pull(result, 'npm'); + return isModularize ? _.first(result, 1) : result; }()); // used to specify the AMD module ID of Lo-Dash used by precompiled templates @@ -4493,7 +4491,7 @@ var isCustom = !isNoDep && ( isLegacy || isMapped || isModern || isStrict || isUnderscore || outputPath || /(?:category|exclude|exports|iife|include|minus|plus)=.*$/.test(options) || - !_.isEqual(exportsOptions, allExports) + !_.isEqual(exportsOptions, ['amd', 'commonjs', 'global', 'node']) ); // used as the basename of the output path