forked from j0nnyboi/js-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (51 loc) · 1.51 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const webpack = require("webpack");
module.exports = {
entry: './src/web/bundlr.ts',
devtool: 'source-map',
mode: "production",
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: [
/node_modules/,
path.resolve(__dirname, "src/node/"),
path.resolve(__dirname, "build/")
],
},
],
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
process: "process/browser",
crypto: "crypto-browserify",
stream: "stream-browserify",
},
fallback: {
"crypto": require.resolve("crypto-browserify"),
"assert": require.resolve("assert/"),
"stream": require.resolve("stream-browserify"),
"process": require.resolve("process/browser"),
"util": require.resolve("util"),
"events": require.resolve("events/"),
"buffer": require.resolve('buffer/'),
"zlib": require.resolve("browserify-zlib"),
"path": require.resolve("path-browserify")
}
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
}),
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build/web'),
libraryTarget: 'umd',
library: 'Bundlr'
},
};