forked from matthiask/workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
36 lines (32 loc) · 1.07 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
const crypto = require("crypto")
const crypto_orig_createHash = crypto.createHash
crypto.createHash = (algorithm) =>
crypto_orig_createHash(algorithm == "md4" ? "sha1" : algorithm)
const merge = require("webpack-merge")
const config = require("fh-webpack-config")
const path = require("path")
const DEBUG = process.env.NODE_ENV !== "production"
const HOST = process.env.HOST || "127.0.0.1"
const HTTPS = !!process.env.HTTPS
module.exports = merge.smart(
config.commonConfig,
// config.chunkSplittingConfig,
config.reactConfig,
{
context: path.join(__dirname),
// devtool: "source-map",
output: {
path: path.resolve("./static/workbench/"),
publicPath: DEBUG
? `http${HTTPS ? "s" : ""}://${HOST}:4000/`
: `${process.env.STATIC_URL || "/static/"}workbench/`,
filename: DEBUG ? "[name].js" : "[name]-[contenthash].js",
},
},
)
// Smart webpack merging is not smart enough to remove the default `main` entrypoint
module.exports.entry = {
timer: "./timer/index.js",
absences: "./absences/index.js",
planning: "./planning/index.js",
}