Skip to content

Commit

Permalink
Adjust webpack configs for webpack v5
Browse files Browse the repository at this point in the history
  • Loading branch information
willclarktech committed Apr 15, 2021
1 parent 5fc6066 commit 2863cef
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 4 deletions.
7 changes: 7 additions & 0 deletions packages/amino/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const glob = require("glob");
const path = require("path");
const webpack = require("webpack");

const target = "web";
const distdir = path.join(__dirname, "dist", "web");
Expand All @@ -13,6 +15,11 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
3 changes: 3 additions & 0 deletions packages/cosmwasm-launchpad/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ module.exports = [
CW3_ENABLED: "",
CW1_ENABLED: "",
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
Expand Down
7 changes: 7 additions & 0 deletions packages/crypto/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const glob = require("glob");
const path = require("path");
const webpack = require("webpack");

const target = "web";
const distdir = path.join(__dirname, "dist", "web");
Expand All @@ -13,6 +15,11 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
7 changes: 6 additions & 1 deletion packages/launchpad/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [new webpack.EnvironmentPlugin({ LAUNCHPAD_ENABLED: "" })],
plugins: [
new webpack.EnvironmentPlugin({ LAUNCHPAD_ENABLED: "" }),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
7 changes: 7 additions & 0 deletions packages/math/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const glob = require("glob");
const path = require("path");
const webpack = require("webpack");

const target = "web";
const distdir = path.join(__dirname, "dist", "web");
Expand All @@ -13,5 +15,10 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
},
];
7 changes: 7 additions & 0 deletions packages/proto-signing/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const glob = require("glob");
const path = require("path");
const webpack = require("webpack");

const target = "web";
const distdir = path.join(__dirname, "dist", "web");
Expand All @@ -13,6 +15,11 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
5 changes: 4 additions & 1 deletion packages/socket/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [new webpack.EnvironmentPlugin({ SOCKETSERVER_ENABLED: "" })],
plugins: [
new webpack.EnvironmentPlugin({ SOCKETSERVER_ENABLED: "" }),
new webpack.ProvidePlugin({ process: "process/browser" }),
],
resolve: {
fallback: {
assert: require.resolve("assert"),
Expand Down
8 changes: 7 additions & 1 deletion packages/stargate/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [new webpack.EnvironmentPlugin({ SIMAPP_ENABLED: "" })],
plugins: [
new webpack.EnvironmentPlugin({ SIMAPP_ENABLED: "" }),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
new webpack.ProvidePlugin({ process: "process/browser" }),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
7 changes: 6 additions & 1 deletion packages/tendermint-rpc/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [new webpack.EnvironmentPlugin({ TENDERMINT_ENABLED: "" })],
plugins: [
new webpack.EnvironmentPlugin({ TENDERMINT_ENABLED: "" }),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
Expand Down
7 changes: 7 additions & 0 deletions packages/utils/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const glob = require("glob");
const path = require("path");
const webpack = require("webpack");

const target = "web";
const distdir = path.join(__dirname, "dist", "web");
Expand All @@ -13,5 +15,10 @@ module.exports = [
path: distdir,
filename: "tests.js",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
},
];

0 comments on commit 2863cef

Please sign in to comment.