From 2b03a2c5a13b96a2bda7c3c6ab1001814f4173be Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Fri, 16 Jun 2023 19:01:32 +0100 Subject: [PATCH] fix[devtools/standalone]: update webpack configurations --- packages/react-devtools-core/package.json | 6 +++++- packages/react-devtools-core/webpack.backend.js | 2 +- packages/react-devtools-core/webpack.standalone.js | 11 ++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/react-devtools-core/package.json b/packages/react-devtools-core/package.json index 11ab5b969bd6f..22f4c020ddae3 100644 --- a/packages/react-devtools-core/package.json +++ b/packages/react-devtools-core/package.json @@ -29,6 +29,10 @@ "ws": "^7" }, "devDependencies": { - "cross-env": "^3.1.4" + "cross-env": "^3.1.4", + "process": "0.11.10", + "webpack": "^5.82.1", + "webpack-cli": "^5.1.1", + "workerize-loader": "^2.0.2" } } diff --git a/packages/react-devtools-core/webpack.backend.js b/packages/react-devtools-core/webpack.backend.js index dc2ddc2789e63..67bf81d0f9965 100644 --- a/packages/react-devtools-core/webpack.backend.js +++ b/packages/react-devtools-core/webpack.backend.js @@ -39,7 +39,7 @@ process.env.BABEL_CONFIG_ADDITIONAL_TARGETS = JSON.stringify({ module.exports = { mode: __DEV__ ? 'development' : 'production', - devtool: __DEV__ ? 'cheap-module-eval-source-map' : 'source-map', + devtool: __DEV__ ? 'eval-cheap-module-source-map' : 'source-map', entry: { backend: './src/backend.js', }, diff --git a/packages/react-devtools-core/webpack.standalone.js b/packages/react-devtools-core/webpack.standalone.js index 363e521f82973..fd37617761752 100644 --- a/packages/react-devtools-core/webpack.standalone.js +++ b/packages/react-devtools-core/webpack.standalone.js @@ -47,7 +47,7 @@ const babelOptions = { module.exports = { mode: __DEV__ ? 'development' : 'production', - devtool: __DEV__ ? 'cheap-module-eval-source-map' : 'source-map', + devtool: __DEV__ ? 'eval-cheap-module-source-map' : 'source-map', target: 'electron-main', entry: { standalone: './src/standalone.js', @@ -56,8 +56,13 @@ module.exports = { path: __dirname + '/dist', filename: '[name].js', chunkFilename: '[name].chunk.js', - library: '[name]', - libraryTarget: 'commonjs2', + library: { + type: 'commonjs2', + }, + }, + externals: { + bufferutil: 'commonjs bufferutil', + 'utf-8-validate': 'commonjs utf-8-validate', }, resolve: { alias: {