forked from firefox-devtools/devtools-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
50 lines (44 loc) · 1.61 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { toolboxConfig } = require("devtools-launchpad/index");
const getConfig = require("./bin/getConfig");
const {isDevelopment} = require("devtools-config");
const path = require("path");
const projectPath = path.join(__dirname);
const webpackConfig = {
entry: {
"devtools-components": path.join(projectPath, "index.js"),
},
output: {
path: path.join(__dirname, "assets/build"),
filename: "[name].js",
publicPath: "/assets/build",
libraryTarget: "umd",
},
resolve: {
alias: {
"devtools/client/shared/vendor/react": "react",
"devtools/client/shared/vendor/react-dom": "react-dom",
"devtools/client/shared/vendor/react-dom-factories": "react-dom-factories",
"devtools/client/shared/vendor/react-prop-types": "prop-types",
"Services": path.join(__dirname,
"node_modules/devtools-modules/client/shared/shim/Services"),
}
}
};
const extra = {
disablePostCSS: true,
};
webpackConfig.plugins = [];
if (!isDevelopment()) {
extra.excludeMap = {
react: "devtools/client/shared/vendor/react",
"react-dom": "devtools/client/shared/vendor/react-dom",
"react-dom-factories": "devtools/client/shared/vendor/react-dom-factories",
"prop-types": "devtools/client/shared/vendor/react-prop-types",
lodash: "devtools/client/shared/vendor/lodash",
};
}
const envConfig = getConfig();
module.exports = toolboxConfig(webpackConfig, envConfig, extra);