mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Merge pull request #1506 from jareguo/master
fix engine bulid error again
This commit is contained in:
+10
-5
@@ -56,15 +56,20 @@ exports.uglifyOptions = function (minify, global_defs) {
|
||||
function allowReturnOutsideFunctionInBrowserifyTransform () {
|
||||
var acorn;
|
||||
try {
|
||||
acorn = require('syntax-error/node_modules/acorn');
|
||||
acorn = require('browserify/node_modules/syntax-error/node_modules/acorn');
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
acorn = require('acorn');
|
||||
acorn = require('syntax-error/node_modules/acorn');
|
||||
}
|
||||
catch (e) {
|
||||
console.warn('Can not find acorn to patch');
|
||||
return;
|
||||
try {
|
||||
acorn = require('acorn');
|
||||
}
|
||||
catch (e) {
|
||||
console.error('Can not find acorn to patch');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +83,7 @@ function allowReturnOutsideFunctionInBrowserifyTransform () {
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.warn('Can not find acorn.parse to patch');
|
||||
console.error('Can not find acorn.parse to patch');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user