From 2850ecad6534654a7bcf03feadba0db873c9e37b Mon Sep 17 00:00:00 2001 From: TZ Date: Thu, 14 Sep 2017 08:18:09 +0800 Subject: [PATCH] fix: use inspector at 7.x+ --- README.md | 2 +- lib/cmd/debug.js | 2 +- test/lib/cmd/debug.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c6bc23a..3e10ed6f 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ $ egg-bin dev Debug egg app with [V8 Inspector Integration](https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js). -automatically detect the protocol used by the targeted runtime, 8.0+ the new 'inspector' protocol is used. +automatically detect the protocol, use the new `inspector` when the targeted runtime >=7.0.0 . use [inspector-proxy](https://github.com/whxaxes/inspector-proxy) to proxy worker debug, so you don't need to worry about reload. diff --git a/lib/cmd/debug.js b/lib/cmd/debug.js index 7a4adf00..6af83b35 100644 --- a/lib/cmd/debug.js +++ b/lib/cmd/debug.js @@ -6,7 +6,7 @@ const InspectorProxy = require('inspector-proxy'); const debug = require('debug')('egg-bin'); const semver = require('semver'); const Command = require('./dev'); -const newDebugger = semver.gte(process.version, '8.0.0'); +const newDebugger = semver.gte(process.version, '7.0.0'); class DebugCommand extends Command { constructor(rawArgv) { diff --git a/test/lib/cmd/debug.test.js b/test/lib/cmd/debug.test.js index 59cb0992..b2c5e8dc 100644 --- a/test/lib/cmd/debug.test.js +++ b/test/lib/cmd/debug.test.js @@ -66,7 +66,7 @@ describe('test/lib/cmd/debug.test.js', () => { describe('real egg', () => { const cwd = path.join(__dirname, '../../fixtures/example'); - const newDebugger = semver.gte(process.version, '8.0.0'); + const newDebugger = semver.gte(process.version, '7.0.0'); it('should proxy', function* () { const app = coffee.fork(eggBin, [ 'debug' ], { cwd });