Skip to content

Commit

Permalink
chore(sio-client): restore the debug package in the dev bundle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
darrachequesne committed Sep 21, 2024
1 parent 93010ca commit 282ae92
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
52 changes: 33 additions & 19 deletions packages/socket.io-client/support/rollup.config.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,15 @@ const banner = `/*!
* Released under the MIT License.
*/`;

module.exports = {
input: "./build/esm/browser-entrypoint.js",
output: [
{
file: "./dist/socket.io.js",
format: "umd",
name: "io",
sourcemap: true,
banner,
},
{
file: "./dist/socket.io.min.js",
format: "umd",
name: "io",
sourcemap: true,
plugins: [terser()],
banner,
},
],
const devBundle = {
input: "./build/esm-debug/browser-entrypoint.js",
output: {
file: "./dist/socket.io.js",
format: "umd",
name: "io",
sourcemap: true,
banner,
},
plugins: [
nodeResolve({
browser: true,
Expand All @@ -41,3 +31,27 @@ module.exports = {
}),
],
};

const prodBundle = {
input: "./build/esm/browser-entrypoint.js",
output: {
file: "./dist/socket.io.min.js",
format: "umd",
name: "io",
sourcemap: true,
plugins: [terser()],
banner,
},
plugins: [
nodeResolve({
browser: true,
}),
babel({
babelHelpers: "bundled",
presets: [["@babel/env"]],
plugins: ["@babel/plugin-transform-object-assign"],
}),
],
};

module.exports = [devBundle, prodBundle];
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const base = require("./rollup.config.umd.js");
const base = require("./rollup.config.umd.js")[1];
const alias = require("@rollup/plugin-alias");
const commonjs = require("@rollup/plugin-commonjs");

module.exports = {
...base,
output: {
...base.output[1],
...base.output,
file: "./dist/socket.io.msgpack.min.js",
},
plugins: [
commonjs(),
alias({
entries: [
{
Expand Down

0 comments on commit 282ae92

Please sign in to comment.