diff --git a/cocos/core/data/class.ts b/cocos/core/data/class.ts index c0e9e66fad..e2660c5d36 100644 --- a/cocos/core/data/class.ts +++ b/cocos/core/data/class.ts @@ -23,7 +23,7 @@ THE SOFTWARE. */ -import { DEV, EDITOR, SUPPORT_JIT, TEST } from 'internal:constants'; +import { DEV, EDITOR, SUPPORT_JIT, TEST, NODEJS } from 'internal:constants'; import { errorID, warnID, error } from '../platform/debug'; import * as js from '../utils/js'; import { getSuper } from '../utils/js'; @@ -179,7 +179,7 @@ function define (className, baseClass, options): any { const cls = doDefine(className, baseClass, options); - if (EDITOR) { + if (EDITOR || NODEJS) { // for RenderPipeline, RenderFlow, RenderStage const isRenderPipeline = js.isChildClassOf(baseClass, legacyCC.RenderPipeline); const isRenderFlow = js.isChildClassOf(baseClass, legacyCC.RenderFlow); diff --git a/cocos/game/game.ts b/cocos/game/game.ts index b5aa19714c..76fedf732e 100644 --- a/cocos/game/game.ts +++ b/cocos/game/game.ts @@ -996,7 +996,7 @@ export class Game extends EventTarget { if (PREVIEW && !TEST && !EDITOR && !NATIVE && !NODEJS) { const bundleName = 'cce:/internal/x/prerequisite-imports'; import(bundleName).then((): void => resolve(), (reason): void => reject(reason)); - } else if (EDITOR && globalThis.cce && globalThis.cce.Script) { + } else if ((EDITOR || NODEJS) && globalThis.cce && globalThis.cce.Script) { globalThis.cce.Script.init().then(() => resolve()); } else { resolve();