Skip to content

Commit

Permalink
preserve the full --inspect= flag as passed to yarn start instead of …
Browse files Browse the repository at this point in the history
…treating it as a boolean
  • Loading branch information
gregmartyn committed Jun 16, 2018
1 parent 6aee5de commit 64f098c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/razzle/config/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ module.exports = (
const nodeArgs = ['-r', 'source-map-support/register'];

// Add --inspect or --inspect-brk flag when enabled
if (process.env.INSPECT_BRK_ENABLED) {
nodeArgs.push('--inspect-brk');
} else if (process.env.INSPECT_ENABLED) {
nodeArgs.push('--inspect');
if (process.env.INSPECT_BRK) {
nodeArgs.push(process.env.INSPECT_BRK);
} else if (process.env.INSPECT) {
nodeArgs.push(process.env.INSPECT);
}

config.plugins = [
Expand Down
7 changes: 2 additions & 5 deletions packages/razzle/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ const setPorts = require('razzle-dev-utils/setPorts');

process.noDeprecation = true; // turns off that loadQuery clutter.

if (process.argv.includes('--inspect-brk')) {
process.env.INSPECT_BRK_ENABLED = true;
} else if (process.argv.includes('--inspect')) {
process.env.INSPECT_ENABLED = true;
}
process.env.INSPECT_BRK = process.argv.find((arg) => arg.match(/--inspect-brk(=|$)/)) || '';
process.env.INSPECT = process.argv.find((arg) => arg.match(/--inspect(=|$)/)) || '';

function main() {
// Optimistically, we make the console look exactly like the output of our
Expand Down

1 comment on commit 64f098c

@jaredpalmer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the docs?

Please sign in to comment.