mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #306 from jareguo/master
make CC_EDITOR available in preview mode
This commit is contained in:
@@ -24,17 +24,17 @@
|
||||
|
||||
// MACROS
|
||||
|
||||
// if "global_defs" not preprocessed by uglify, just declare them globally
|
||||
// (use eval to prevent the uglify from renaming symbols)
|
||||
if (typeof CC_TEST === 'undefined') {
|
||||
eval('CC_TEST=typeof describe!=="undefined"||typeof QUnit=="object"');
|
||||
}
|
||||
if (typeof CC_EDITOR === 'undefined') {
|
||||
eval('CC_EDITOR=typeof Editor=="object"&&typeof process=="object"&&"electron" in process.versions');
|
||||
}
|
||||
if (typeof CC_DEV === 'undefined') {
|
||||
eval('CC_DEV=CC_EDITOR||CC_TEST');
|
||||
}
|
||||
// if "global_defs" not preprocessed by uglify, just declare them globally,
|
||||
// this may happened in release version's preview page.
|
||||
eval(
|
||||
/* use EVAL to prevent the uglify from renaming symbols */
|
||||
'if(typeof CC_TEST=="undefined")' +
|
||||
'CC_TEST=typeof describe!="undefined"||typeof QUnit=="object";' +
|
||||
'if(typeof CC_EDITOR=="undefined")' +
|
||||
'CC_EDITOR=typeof Editor=="object"&&typeof process=="object"&&"electron" in process.versions;' +
|
||||
'if(typeof CC_DEV=="undefined")' +
|
||||
'CC_DEV=CC_EDITOR||CC_TEST;'
|
||||
);
|
||||
|
||||
// PREDEFINE
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
"gulp-rename": "1.2.2",
|
||||
"gulp-shell": "0.4.1",
|
||||
"gulp-sourcemaps": "1.5.2",
|
||||
"gulp-uglify": "1.2.0",
|
||||
"gulp-uglify": "1.5.1",
|
||||
"gulp-util": "3.0.6",
|
||||
"jshint-stylish": "2.1.0",
|
||||
"require-dir": "0.3.0",
|
||||
|
||||
Reference in New Issue
Block a user