reduce browser bundle size

reduces browser bundle size by ~612k or ~92%.
This commit is contained in:
Stefan Aebischer
2021-05-15 19:34:32 +02:00
parent c5fb3f2b02
commit 082633a5ca
8 changed files with 38 additions and 464 deletions

View File

@@ -18,10 +18,9 @@ function generateConfig(name) {
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"],
fallback: {
"crypto": require.resolve("crypto-browserify"),
"buffer": require.resolve("buffer/"),
"stream": require.resolve("stream-browserify")
alias: {
[path.resolve(__dirname, "../lib/util/node-support.js")]:
path.resolve(__dirname, "../lib/util/browser-support.js"),
}
},
@@ -66,4 +65,4 @@ function generateConfig(name) {
return config;
}
module.exports = generateConfig('bybitapi');
module.exports = generateConfig('bybitapi');