forked from pk910/PoWFaucet
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
37 lines (34 loc) · 845 Bytes
/
webpack.config.js
File metadata and controls
37 lines (34 loc) · 845 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
35
36
37
import path, { dirname } from "path";
import fs from "fs";
import { fileURLToPath } from "url";
import webpack from "webpack";
let importUrl = fileURLToPath(import.meta.url);
const basedir = dirname(importUrl);
let packageJson = JSON.parse(
fs.readFileSync(path.join(basedir, "package.json"), "utf8")
);
export default {
entry: {
app: "./dist/app.js",
PoWValidatorWorker: "./dist/modules/pow/validator/PoWValidatorWorker.js",
},
target: "node",
resolve: {
extensions: [".ts", ".js"],
},
output: {
filename: "[name].cjs",
path: path.resolve(basedir, "bundle"),
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
new webpack.DefinePlugin({
POWFAUCET_VERSION: JSON.stringify(packageJson.version),
}),
],
optimization: {
minimize: false,
},
};