Skip to content

Commit 39289bb

Browse files
committed
Launch PowerShell agent in on middleware-creation
1 parent cd28840 commit 39289bb

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

packages/react-error-overlay/middleware.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
const { launchEditor } = require('react-dev-utils/launchEditor');
1212

1313
module.exports = function createLaunchEditorMiddleware() {
14+
if (process.platform === 'win32') {
15+
const { launchPowerShellAgent } = require('react-dev-utils/launchEditor');
16+
launchPowerShellAgent();
17+
}
18+
1419
return function launchEditorMiddleware(req, res, next) {
1520
// Keep this in sync with react-error-overlay
1621
if (req.url.startsWith('/__open-stack-frame-in-editor')) {

packages/react-scripts/scripts/start.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ choosePort(HOST, DEFAULT_PORT)
8585
}
8686
console.log(chalk.cyan('Starting the development server...\n'));
8787
openBrowser(urls.localUrlForBrowser);
88-
if (process.platform === 'win32') {
89-
const {
90-
launchPowerShellAgent,
91-
} = require('react-dev-utils/launchEditor');
92-
launchPowerShellAgent();
93-
}
9488
});
9589

9690
['SIGINT', 'SIGTERM'].forEach(function(sig) {

0 commit comments

Comments
 (0)