Skip to content

Commit d09fc0b

Browse files
committed
Adjust webpack configs for webpack v5
1 parent 5fc6066 commit d09fc0b

File tree

11 files changed

+64
-4
lines changed

11 files changed

+64
-4
lines changed

packages/amino/webpack.web.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
12
const glob = require("glob");
23
const path = require("path");
4+
const webpack = require("webpack");
35

46
const target = "web";
57
const distdir = path.join(__dirname, "dist", "web");
@@ -13,6 +15,11 @@ module.exports = [
1315
path: distdir,
1416
filename: "tests.js",
1517
},
18+
plugins: [
19+
new webpack.ProvidePlugin({
20+
Buffer: ["buffer", "Buffer"],
21+
}),
22+
],
1623
resolve: {
1724
fallback: {
1825
crypto: require.resolve("crypto-browserify"),

packages/cosmwasm-launchpad/webpack.web.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module.exports = [
2222
CW3_ENABLED: "",
2323
CW1_ENABLED: "",
2424
}),
25+
new webpack.ProvidePlugin({
26+
Buffer: ["buffer", "Buffer"],
27+
}),
2528
],
2629
resolve: {
2730
fallback: {

packages/cosmwasm-stargate/webpack.web.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module.exports = [
2222
CW3_ENABLED: "",
2323
CW1_ENABLED: "",
2424
}),
25+
new webpack.ProvidePlugin({
26+
Buffer: ["buffer", "Buffer"],
27+
}),
2528
],
2629
resolve: {
2730
fallback: {

packages/crypto/webpack.web.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
12
const glob = require("glob");
23
const path = require("path");
4+
const webpack = require("webpack");
35

46
const target = "web";
57
const distdir = path.join(__dirname, "dist", "web");
@@ -13,6 +15,11 @@ module.exports = [
1315
path: distdir,
1416
filename: "tests.js",
1517
},
18+
plugins: [
19+
new webpack.ProvidePlugin({
20+
Buffer: ["buffer", "Buffer"],
21+
}),
22+
],
1623
resolve: {
1724
fallback: {
1825
crypto: require.resolve("crypto-browserify"),

packages/launchpad/webpack.web.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ module.exports = [
1515
path: distdir,
1616
filename: "tests.js",
1717
},
18-
plugins: [new webpack.EnvironmentPlugin({ LAUNCHPAD_ENABLED: "" })],
18+
plugins: [
19+
new webpack.EnvironmentPlugin({ LAUNCHPAD_ENABLED: "" }),
20+
new webpack.ProvidePlugin({
21+
Buffer: ["buffer", "Buffer"],
22+
}),
23+
],
1924
resolve: {
2025
fallback: {
2126
crypto: require.resolve("crypto-browserify"),

packages/math/webpack.web.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
12
const glob = require("glob");
23
const path = require("path");
4+
const webpack = require("webpack");
35

46
const target = "web";
57
const distdir = path.join(__dirname, "dist", "web");
@@ -13,5 +15,10 @@ module.exports = [
1315
path: distdir,
1416
filename: "tests.js",
1517
},
18+
plugins: [
19+
new webpack.ProvidePlugin({
20+
Buffer: ["buffer", "Buffer"],
21+
}),
22+
],
1623
},
1724
];

packages/proto-signing/webpack.web.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
12
const glob = require("glob");
23
const path = require("path");
4+
const webpack = require("webpack");
35

46
const target = "web";
57
const distdir = path.join(__dirname, "dist", "web");
@@ -13,6 +15,11 @@ module.exports = [
1315
path: distdir,
1416
filename: "tests.js",
1517
},
18+
plugins: [
19+
new webpack.ProvidePlugin({
20+
Buffer: ["buffer", "Buffer"],
21+
}),
22+
],
1623
resolve: {
1724
fallback: {
1825
crypto: require.resolve("crypto-browserify"),

packages/socket/webpack.web.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ module.exports = [
1515
path: distdir,
1616
filename: "tests.js",
1717
},
18-
plugins: [new webpack.EnvironmentPlugin({ SOCKETSERVER_ENABLED: "" })],
18+
plugins: [
19+
new webpack.EnvironmentPlugin({ SOCKETSERVER_ENABLED: "" }),
20+
new webpack.ProvidePlugin({ process: "process/browser" }),
21+
],
1922
resolve: {
2023
fallback: {
2124
assert: require.resolve("assert"),

packages/stargate/webpack.web.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ module.exports = [
1515
path: distdir,
1616
filename: "tests.js",
1717
},
18-
plugins: [new webpack.EnvironmentPlugin({ SIMAPP_ENABLED: "" })],
18+
plugins: [
19+
new webpack.EnvironmentPlugin({ SIMAPP_ENABLED: "" }),
20+
new webpack.ProvidePlugin({
21+
Buffer: ["buffer", "Buffer"],
22+
}),
23+
new webpack.ProvidePlugin({ process: "process/browser" }),
24+
],
1925
resolve: {
2026
fallback: {
2127
crypto: require.resolve("crypto-browserify"),

packages/tendermint-rpc/webpack.web.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ module.exports = [
1515
path: distdir,
1616
filename: "tests.js",
1717
},
18-
plugins: [new webpack.EnvironmentPlugin({ TENDERMINT_ENABLED: "" })],
18+
plugins: [
19+
new webpack.EnvironmentPlugin({ TENDERMINT_ENABLED: "" }),
20+
new webpack.ProvidePlugin({
21+
Buffer: ["buffer", "Buffer"],
22+
}),
23+
],
1924
resolve: {
2025
fallback: {
2126
crypto: require.resolve("crypto-browserify"),

packages/utils/webpack.web.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
12
const glob = require("glob");
23
const path = require("path");
4+
const webpack = require("webpack");
35

46
const target = "web";
57
const distdir = path.join(__dirname, "dist", "web");
@@ -13,5 +15,10 @@ module.exports = [
1315
path: distdir,
1416
filename: "tests.js",
1517
},
18+
plugins: [
19+
new webpack.ProvidePlugin({
20+
Buffer: ["buffer", "Buffer"],
21+
}),
22+
],
1623
},
1724
];

0 commit comments

Comments
 (0)