Skip to content

Commit cbf0a2a

Browse files
committed
[DevTools] Use a single Webpack config for the extensions
1 parent 81d6692 commit cbf0a2a

File tree

3 files changed

+11
-145
lines changed

3 files changed

+11
-145
lines changed

packages/react-devtools-extensions/build.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ const build = async (tempPath, manifestPath, envExtension = {}) => {
6666
stdio: 'inherit',
6767
},
6868
);
69-
execSync(
70-
`${webpackPath} --config webpack.backend.js --output-path ${binPath}`,
71-
{
72-
cwd: __dirname,
73-
env: mergedEnv,
74-
stdio: 'inherit',
75-
},
76-
);
7769

7870
// Make temp dir
7971
await ensureDir(zipPath);

packages/react-devtools-extensions/webpack.backend.js

Lines changed: 0 additions & 135 deletions
This file was deleted.

packages/react-devtools-extensions/webpack.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module.exports = {
6666
mode: __DEV__ ? 'development' : 'production',
6767
devtool: false,
6868
entry: {
69+
backend: './src/backend.js',
6970
background: './src/background/index.js',
7071
backendManager: './src/contentScripts/backendManager.js',
7172
fileFetcher: './src/contentScripts/fileFetcher.js',
@@ -79,7 +80,14 @@ module.exports = {
7980
output: {
8081
path: __dirname + '/build',
8182
publicPath: '/build/',
82-
filename: '[name].js',
83+
filename: chunkData => {
84+
switch (chunkData.chunk.name) {
85+
case 'backend':
86+
return 'react_devtools_backend_compact.js';
87+
default:
88+
return '[name].js';
89+
}
90+
},
8391
chunkFilename: '[name].chunk.js',
8492
},
8593
node: {
@@ -141,7 +149,7 @@ module.exports = {
141149
}),
142150
new Webpack.SourceMapDevToolPlugin({
143151
filename: '[file].map',
144-
include: 'installHook.js',
152+
include: ['installHook.js', 'react_devtools_backend_compact.js'],
145153
noSources: !__DEV__,
146154
// https://github.com/webpack/webpack/issues/3603#issuecomment-1743147144
147155
moduleFilenameTemplate(info) {
@@ -163,6 +171,7 @@ module.exports = {
163171
}
164172

165173
const contentScriptNamesToIgnoreList = [
174+
'react_devtools_backend_compact',
166175
// This is where we override console
167176
'installHook',
168177
];

0 commit comments

Comments
 (0)