-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
34 lines (29 loc) · 962 Bytes
/
webpack.dev.config.js
File metadata and controls
34 lines (29 loc) · 962 Bytes
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
const path = require("path");
const webpack = require("webpack");
const webpackConfig = require("./webpack.base.config");
const npmPkg = require("./package.json");
webpackConfig.output.path = path.resolve(__dirname, "test");
const numericIdentifier = Math.abs(
(!!npmPkg && !!npmPkg.name ? npmPkg.name : __dirname)
.split("")
.reduce((acc, char, i) => acc + (i + 27) * (char.codePointAt(0) - 97), 0) +
1025
);
const port = Math.min(65336, numericIdentifier);
webpackConfig.devtool = "cheap-module-eval-source-map";
webpackConfig.devServer = {
contentBase: [
path.join(__dirname, "test"),
path.join(__dirname, "node_modules/gpml2pvjson/test/expected"),
path.join(__dirname, "node_modules/@wikipathways/gpml/test/2013a")
],
port: port
};
[
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("dev")
})
].forEach(function(plugin) {
webpackConfig.plugins.push(plugin);
});
module.exports = webpackConfig;