diff --git a/packages/embark-typings/src/embark.d.ts b/packages/embark-typings/src/embark.d.ts index db10cfc0a..a1e413956 100644 --- a/packages/embark-typings/src/embark.d.ts +++ b/packages/embark-typings/src/embark.d.ts @@ -31,5 +31,6 @@ export interface Embark { logger: Logger; fs: any; config: Config; + currentContext: string[]; registerActionForEvent(name: string, action: (callback: () => void) => void): void; } diff --git a/packages/embark/src/lib/modules/console/index.ts b/packages/embark/src/lib/modules/console/index.ts index 7721ff864..d5d51854a 100644 --- a/packages/embark/src/lib/modules/console/index.ts +++ b/packages/embark/src/lib/modules/console/index.ts @@ -3,6 +3,7 @@ const env = require("../../core/env"); const utils = require("../../utils/utils"); const escapeHtml = require("../../utils/escapeHtml"); import { Callback } from "embark"; +import constants from "../../constants.json"; const stringify = require("json-stringify-safe"); import { waterfall } from "async"; import { Embark, Events } from "embark"; @@ -85,7 +86,7 @@ class Console { } private get isEmbarkConsole() { - return this.ipc.connected && this.ipc.isClient(); + return this.ipc.connected && this.ipc.isClient() && this.embark.currentContext && this.embark.currentContext.includes(constants.contexts.console); } private cmdHistorySize() { diff --git a/tsconfig.json b/tsconfig.json index cabf85f35..06c44eab0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "noEmit": true, "noImplicitThis": false, "strict": true, - "target": "ES2017" + "target": "ES2017", + "resolveJsonModule": true } }