-
Notifications
You must be signed in to change notification settings - Fork 54
/
webpack.config.js
43 lines (41 loc) · 1018 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
43
"use strict";
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./site/index.js",
output: {
path: path.resolve(__dirname, "docs", "dist"),
filename: "bundle.js",
},
devServer: {
devMiddleware: {
publicPath: "/dist/",
},
static: {
directory: path.resolve(__dirname, "docs"),
watch: true,
},
open: true,
},
resolve: {
fallback: {
assert: require.resolve("assert"),
fs: false,
util: require.resolve("util"),
path: require.resolve("path-browserify"),
crypto: require.resolve("crypto-browserify"),
zlib: require.resolve("browserify-zlib"),
stream: require.resolve("stream-browserify"),
constants: require.resolve("constants-browserify"),
},
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_DEBUG": process.env.NODE_DEBUG,
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process",
}),
],
};