forked from akash-network/akashjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (38 loc) · 934 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
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const path = require("path");
module.exports = {
entry: "./src/index.ts",
externals: {
"node:crypto": "src/webpack/crypto"
},
resolve: {
alias: {
// add as many aliases as you like!
keytar: path.resolve(__dirname, "src/wallet/storage.ts"),
perf_hooks: path.resolve(__dirname, "src/webpack/perf_hooks.ts")
},
extensions: [".wasm", ".mjs", ".js", ".json", ".jsx", ".ts"],
fallback: {
http: require.resolve("stream-http")
}
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader"
}
]
},
plugins: [new NodePolyfillPlugin()],
output: {
filename: "akashjs.js",
path: path.resolve(__dirname, "umd"),
library: {
type: "umd",
name: "akjs"
},
// prevent error: `Uncaught ReferenceError: self is not define`
globalObject: "this"
}
};