-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.config.js
42 lines (40 loc) · 991 Bytes
/
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
/**
* Webpack config to bundle WasmWebTerm
* Generates the files "webterm.bundle.js" and "webterm.bundle.js.map"
*/
const webpack = require("webpack")
module.exports = {
entry: {
WasmWebTerm: "./src/WasmWebTerm.js",
},
output: {
path: __dirname,
filename: "webterm.bundle.js",
library: { type: "umd", name: "[name]" },
},
optimization: {
moduleIds: "deterministic", // share deterministic ids with the worker bundle
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process/browser",
}),
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(process.env.npm_package_version),
}),
],
module: {
rules: [
{
test: __dirname + "/src/runners/WasmWorker.js",
use: [{ loader: "worker-loader" }],
type: "asset/source",
},
],
},
resolveLoader: {
alias: { "worker-loader": __dirname + "/worker.loader.js" },
},
devtool: "source-map",
}