From a4d5eb770f0a573881a916c84d8d7878b663b396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Fri, 22 Nov 2019 16:33:59 +0800 Subject: [PATCH] debug context id acquire from file --- js-framework/index.debug.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js-framework/index.debug.ts b/js-framework/index.debug.ts index 4d8c0298..9f2d8eba 100644 --- a/js-framework/index.debug.ts +++ b/js-framework/index.debug.ts @@ -16,10 +16,12 @@ import * as doric from './src/runtime/sandbox' import * as WebSocket from 'ws' const WebSocketClient = require('ws') - +const fs = require('fs') +let context = process.cwd() + '/build/context' +const contextId = fs.readFileSync(context, { encoding: 'utf8' }) +console.log(contextId) let global = new Function('return this')() global.doric = doric -const contextId = "1" global.context = doric.jsObtainContext(contextId) global.Entry = doric.jsObtainEntry(contextId)