Skip to content

Commit 282ae92

Browse files
chore(sio-client): restore the debug package in the dev bundle
The debug package was not included anymore in the dev bundle since the migration from webpack to rollup ([1]) in version 4.3.0. [1]: socketio/socket.io-client@0661564 Related: #5108
1 parent 93010ca commit 282ae92

File tree

2 files changed

+37
-21
lines changed

2 files changed

+37
-21
lines changed

packages/socket.io-client/support/rollup.config.umd.js

+33-19
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,15 @@ const banner = `/*!
1010
* Released under the MIT License.
1111
*/`;
1212

13-
module.exports = {
14-
input: "./build/esm/browser-entrypoint.js",
15-
output: [
16-
{
17-
file: "./dist/socket.io.js",
18-
format: "umd",
19-
name: "io",
20-
sourcemap: true,
21-
banner,
22-
},
23-
{
24-
file: "./dist/socket.io.min.js",
25-
format: "umd",
26-
name: "io",
27-
sourcemap: true,
28-
plugins: [terser()],
29-
banner,
30-
},
31-
],
13+
const devBundle = {
14+
input: "./build/esm-debug/browser-entrypoint.js",
15+
output: {
16+
file: "./dist/socket.io.js",
17+
format: "umd",
18+
name: "io",
19+
sourcemap: true,
20+
banner,
21+
},
3222
plugins: [
3323
nodeResolve({
3424
browser: true,
@@ -41,3 +31,27 @@ module.exports = {
4131
}),
4232
],
4333
};
34+
35+
const prodBundle = {
36+
input: "./build/esm/browser-entrypoint.js",
37+
output: {
38+
file: "./dist/socket.io.min.js",
39+
format: "umd",
40+
name: "io",
41+
sourcemap: true,
42+
plugins: [terser()],
43+
banner,
44+
},
45+
plugins: [
46+
nodeResolve({
47+
browser: true,
48+
}),
49+
babel({
50+
babelHelpers: "bundled",
51+
presets: [["@babel/env"]],
52+
plugins: ["@babel/plugin-transform-object-assign"],
53+
}),
54+
],
55+
};
56+
57+
module.exports = [devBundle, prodBundle];

packages/socket.io-client/support/rollup.config.umd.msgpack.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
const base = require("./rollup.config.umd.js");
1+
const base = require("./rollup.config.umd.js")[1];
22
const alias = require("@rollup/plugin-alias");
3+
const commonjs = require("@rollup/plugin-commonjs");
34

45
module.exports = {
56
...base,
67
output: {
7-
...base.output[1],
8+
...base.output,
89
file: "./dist/socket.io.msgpack.min.js",
910
},
1011
plugins: [
12+
commonjs(),
1113
alias({
1214
entries: [
1315
{

0 commit comments

Comments
 (0)