-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (48 loc) · 1.35 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
const path = require("path")
const webpack = require("webpack")
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin
module.exports = {
entry: "./src/index.ts",
devtool: "inline-source-map",
target: "web",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/
}
]
},
resolve: {
extensions: [".ts", ".js"],
fallback: {
crypto: require.resolve("crypto-browserify"),
path: require.resolve("path-browserify"),
os: require.resolve("os-browserify/browser"),
stream: require.resolve("stream-browserify"),
buffer: require.resolve("buffer"),
url: require.resolve("url"),
assert: require.resolve("assert")
},
alias: {
child_process: path.resolve(__dirname, "mock/mock_module.js"),
fs: path.resolve(__dirname, "mock/mock_module.js")
}
},
output: {
filename: "bitcoin-predict.js",
sourceMapFilename: "bitcoin-predict.map",
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd"
},
plugins: [
// new webpack.IgnorePlugin({ resourceRegExp: /child_process$/ }),
new webpack.IgnorePlugin({ resourceRegExp: /predictionMarket.scrypt$/ }),
new webpack.ProvidePlugin({
process: "process/browser"
})
// new BundleAnalyzerPlugin()
]
}