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.0.0.

[1]: socketio/socket.io-client@0661564
  • Loading branch information
darrachequesne committed Sep 21, 2024
1 parent d67fe13 commit c558976
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 @@ -40,4 +30,28 @@ module.exports = {
plugins: ["@babel/plugin-transform-object-assign"],
}),
],
}

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 c558976

Please sign in to comment.