feat: add global eventCenter & static console source map
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
		@@ -4,6 +4,7 @@ import { plugin, server, task, constants } from '@ccms/api'
 | 
			
		||||
import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ccms/container'
 | 
			
		||||
console.i18n("ms.core.ioc.completed", { scope: global.scope, time: (Date.now() - containerStartTime) / 1000 })
 | 
			
		||||
import http from '@ccms/common/dist/http'
 | 
			
		||||
import { EventEmitter } from 'events'
 | 
			
		||||
 | 
			
		||||
@provideSingleton(MiaoScriptCore)
 | 
			
		||||
class MiaoScriptCore {
 | 
			
		||||
@@ -25,6 +26,7 @@ class MiaoScriptCore {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    loadServerConsole() {
 | 
			
		||||
        global.setGlobal('eventCenter', new EventEmitter(), { writable: false, configurable: false });
 | 
			
		||||
        //@ts-ignore
 | 
			
		||||
        global.setGlobal('console', new this.Console(), { writable: false, configurable: false })
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user