Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit f0ca19e

Browse files
committed
Exclude lodash from bundle.
lodash is vendored in mozilla-central so we can omit it here.
1 parent c6afb6d commit f0ca19e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/devtools-reps/webpack.config.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const { toolboxConfig } = require("devtools-launchpad/index");
66
const getConfig = require("./bin/getConfig");
7-
const {isFirefoxPanel} = require("devtools-config");
7+
const {isDevelopment, isFirefoxPanel} = require("devtools-config");
88

99
const path = require("path");
1010
const projectPath = path.join(__dirname, "src");
@@ -38,5 +38,17 @@ webpackConfig.resolve = {
3838
}
3939
};
4040

41+
const extra = {};
42+
webpackConfig.plugins = [];
43+
if (!isDevelopment()) {
44+
webpackConfig.output.libraryTarget = "umd";
45+
46+
extra.excludeMap = {
47+
react: "devtools/client/shared/vendor/react",
48+
"react-dom": "devtools/client/shared/vendor/react-dom",
49+
lodash: "devtools/client/shared/vendor/lodash",
50+
};
51+
}
52+
4153
const envConfig = getConfig();
42-
module.exports = toolboxConfig(webpackConfig, envConfig);
54+
module.exports = toolboxConfig(webpackConfig, envConfig, extra);

0 commit comments

Comments
 (0)