From 9e246f7682eb7b1fb0b7a66e218ad1963fc61969 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Wed, 30 May 2018 21:39:59 +0800 Subject: [PATCH] fix uglify-es (#2771) --- cocos2d/core/platform/url.js | 3 ++- gulp/util/utils.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/platform/url.js b/cocos2d/core/platform/url.js index 986833a82a..df4a43fe68 100644 --- a/cocos2d/core/platform/url.js +++ b/cocos2d/core/platform/url.js @@ -88,7 +88,8 @@ cc.url = { } } else { - // backward compatibility since 1.10 + + // Compatible with versions lower than 1.10 var uuid = cc.loader._getResUuid(url.slice(10), cc.Asset, true); if (uuid) { return cc.AssetLibrary.getLibUrlNoExt(uuid) + cc.path.extname(url); diff --git a/gulp/util/utils.js b/gulp/util/utils.js index 45774f5c61..9ea3057676 100644 --- a/gulp/util/utils.js +++ b/gulp/util/utils.js @@ -58,6 +58,7 @@ exports.getUglifyOptions = function (platform, flags) { sequences: false, keep_infinity: true, // reduce jsc file size typeofs: false, + inline: 1, // workaround mishoo/UglifyJS2#2842 }, output: { beautify: true, // really preserve_lines @@ -76,6 +77,7 @@ exports.getUglifyOptions = function (platform, flags) { compress: { global_defs: global_defs, negate_iife: false, + inline: 1, // workaround mishoo/UglifyJS2#2842 }, output: { ascii_only: true,