forked from Web3Auth/web3auth-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
30 lines (25 loc) · 730 Bytes
/
webpack.config.js
File metadata and controls
30 lines (25 loc) · 730 Bytes
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
/* eslint-disable @typescript-eslint/no-var-requires */
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
function generateWebpackConfig({ alias, module = {}, ssrModule = null, pkgBaseConfig = {} }) {
const baseConfig = {
...pkgBaseConfig,
resolve: {
plugins: [new TsconfigPathsPlugin()],
alias: {
"bn.js": require.resolve("bn.js"),
lodash$: require.resolve("lodash-es"),
tweetnacl: require.resolve("@toruslabs/tweetnacl-js"),
...alias,
},
},
};
const config = { baseConfig };
config.umdConfig = {
module,
};
config.cjsConfig = {
module: ssrModule || module,
};
return config;
}
module.exports = generateWebpackConfig;