Skip to content
Permalink
Browse files

fix: use inspector at 7.x+ (#74)

  • Loading branch information
atian25 authored and fengmk2 committed Sep 14, 2017
1 parent 1c25bad commit 2e3498e6ca1b81814a2d1a4db4a8a37fb0d6d880
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.md
  2. +1 −1 lib/cmd/debug.js
  3. +1 −1 test/lib/cmd/debug.test.js
@@ -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.

@@ -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) {
@@ -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 });

0 comments on commit 2e3498e

Please sign in to comment.
You can’t perform that action at this time.