-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
37 lines (36 loc) · 1023 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
const webpack = require('webpack')
const CopyPlugin = require("copy-webpack-plugin")
const path = require('path');
const pathName = path.resolve(__dirname, 'dist')
module.exports = {
entry: './index.js',
output: {
path: pathName,
filename: 'bundle.js',
},
mode: "production",
resolve: {
fallback: {
"fs": false,
"stream": require.resolve("stream-browserify"),
"buffer": require.resolve("buffer/"),
"assert": require.resolve("assert/"),
"os": require.resolve("os-browserify/browser"),
"tty": require.resolve("tty-browserify"),
"module": false,
"child_process": false
},
},
plugins: [
new webpack.NormalModuleReplacementPlugin(
/node_modules\/supports-color\/browser.js/,
path.resolve(__dirname, 'patched-supports-color.js')
),
new CopyPlugin({
patterns: [
{ from: "test.html", to: "index.html" },
{ from: "node_modules/xterm/css/xterm.css", to: "xterm.css" },
],
}),
]
};