diff --git a/desktop/flipper-ui-browser/src/initializeRenderHost.tsx b/desktop/flipper-ui-browser/src/initializeRenderHost.tsx index d4c458b0e..4aeb4168b 100644 --- a/desktop/flipper-ui-browser/src/initializeRenderHost.tsx +++ b/desktop/flipper-ui-browser/src/initializeRenderHost.tsx @@ -82,10 +82,13 @@ export function initializeRenderHost( flipperServer, async requirePlugin(path) { let source = await flipperServer.exec('plugin-source', path); + // append source url (to make sure a file entry shows up in the debugger) source += `\n//# sourceURL=file://${path}`; - // and source map url (to get source code if available) - source += `\n//# sourceMappingURL=file://${path.replace(/.js$/, '.map')}`; + if (isProduction()) { + // and source map url (to get source code if available) + source += `\n//# sourceMappingURL=file://${path}.map`; + } // Plugins are compiled as typical CJS modules, referring to the global // 'module', which we'll make available by loading the source into a closure that captures 'module'. diff --git a/desktop/pkg-lib/src/runBuild.tsx b/desktop/pkg-lib/src/runBuild.tsx index ddcd87440..693b93990 100644 --- a/desktop/pkg-lib/src/runBuild.tsx +++ b/desktop/pkg-lib/src/runBuild.tsx @@ -66,7 +66,7 @@ async function runBuild({ // It is an optional dependency for rollup that we use in react-devtools 'fsevents', ], - sourcemap: 'external', + sourcemap: dev ? 'inline' : 'external', minify: !dev, plugins: intern ? [resolveFbStubsToFbPlugin] : undefined, });