@@ -12,7 +12,7 @@ import Store from 'src/devtools/store';
12
12
import { getSavedComponentFilters , getAppendComponentStack } from 'src/utils' ;
13
13
import { Server } from 'ws' ;
14
14
import { join } from 'path' ;
15
- import { existsSync , readFileSync } from 'fs' ;
15
+ import { readFileSync } from 'fs' ;
16
16
import { installHook } from 'src/hook' ;
17
17
import DevTools from 'src/devtools/views/DevTools' ;
18
18
import { doesFilePathExist , launchEditor } from './editor' ;
@@ -257,15 +257,8 @@ function startServer(port?: number = 8097) {
257
257
} ) ;
258
258
259
259
httpServer . on ( 'request' , ( request , response ) => {
260
- // NPM installs should read from node_modules,
261
- // But local dev mode needs to use a relative path.
262
- let basePath = join ( __dirname , 'node_modules/react-devtools-core' ) ;
263
- if ( ! existsSync ( basePath ) ) {
264
- basePath = '../react-devtools-core' ;
265
- }
266
-
267
260
// Serve a file that immediately sets up the connection.
268
- const backendFile = readFileSync ( ` ${ basePath } /dist/ backend.js` ) ;
261
+ const backendFile = readFileSync ( join ( __dirname , ' backend.js' ) ) ;
269
262
270
263
// The renderer interface doesn't read saved component filters directly,
271
264
// because they are generally stored in localStorage within the context of the extension.
0 commit comments