-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathwebpack.browser.dev.config.js
More file actions
48 lines (42 loc) · 1.04 KB
/
webpack.browser.dev.config.js
File metadata and controls
48 lines (42 loc) · 1.04 KB
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
const path = require("path");
const webpack = require("webpack");
const webpackConfig = require("./webpack.base.config");
webpackConfig.entry = {
cli: "./esnext/cli.js",
"Pvjs.vanilla": "./esnext/browser.js",
Pvjs: "./esnext/Pvjs.js",
jQueryPvjsPlugin: "./esnext/jQueryPvjsPlugin.js"
};
webpackConfig.output = {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
library: "[name]",
libraryTarget: "umd"
};
webpackConfig.devtool = "cheap-module-eval-source-map";
webpackConfig.devServer = {
contentBase: [
path.join(__dirname, "test"),
path.join(__dirname, "dist"),
path.join(__dirname, "node_modules/gpml2pvjson/test/expected")
],
//compress: true,
port: 9000
};
webpackConfig.module.rules.push({
test: require.resolve("react-dom"),
use: [
{
loader: "expose-loader",
options: "ReactDOM"
}
]
});
[
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("dev")
})
].forEach(function(plugin) {
webpackConfig.plugins.push(plugin);
});
module.exports = webpackConfig;