@@ -12,7 +12,7 @@ import Store from 'src/devtools/store';
1212import { getSavedComponentFilters , getAppendComponentStack } from 'src/utils' ;
1313import { Server } from 'ws' ;
1414import { join } from 'path' ;
15- import { existsSync , readFileSync } from 'fs' ;
15+ import { readFileSync } from 'fs' ;
1616import { installHook } from 'src/hook' ;
1717import DevTools from 'src/devtools/views/DevTools' ;
1818import { doesFilePathExist , launchEditor } from './editor' ;
@@ -257,15 +257,8 @@ function startServer(port?: number = 8097) {
257257 } ) ;
258258
259259 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-
267260 // 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' ) ) ;
269262
270263 // The renderer interface doesn't read saved component filters directly,
271264 // because they are generally stored in localStorage within the context of the extension.
0 commit comments