Skip to content

Commit

Permalink
chore: migrate to rollup
Browse files Browse the repository at this point in the history
This change allows us to:

- reduce the size of the bundle
- provide an ESM bundle (for usage in <script type="module">)

Related: #1198
  • Loading branch information
darrachequesne committed Oct 13, 2021
1 parent 16b6569 commit 0661564
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/browser-entrypoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { io } from "./index.js";

export default io;
251 changes: 251 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"@babel/core": "^7.15.0",
"@babel/plugin-transform-object-assign": "^7.14.5",
"@babel/preset-env": "^7.15.0",
"@rollup/plugin-alias": "^3.1.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@sinonjs/fake-timers": "^7.1.2",
"@types/mocha": "^9.0.0",
"@types/node": "^16.7.6",
Expand All @@ -55,6 +59,8 @@
"mocha": "^3.3.0",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"rollup": "^2.58.0",
"rollup-plugin-terser": "^7.0.2",
"socket.io": "3.0.0",
"socket.io-browsers": "^1.0.0",
"socket.io-msgpack-parser": "^3.0.0",
Expand All @@ -76,7 +82,7 @@
"test:node": "mocha --require ts-node/register --reporter dot --require test/support/server.js test/index.js",
"test:browser": "zuul test/index.js",
"test:types": "tsd",
"build": "npm run compile && webpack --config ./support/webpack.config.js --config ./support/prod.config.js --config ./support/msgpack-parser.config.js",
"build": "rollup -c support/rollup.config.umd.js && rollup -c support/rollup.config.esm.js && rollup -c support/rollup.config.umd.msgpack.js",
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.js\" \"test/**/*.ts\" \"support/**/*.js\"",
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.js\" \"test/**/*.ts\" \"support/**/*.js\"",
"prepack": "npm run compile"
Expand Down
Loading

0 comments on commit 0661564

Please sign in to comment.