Skip to content

Commit 06e6838

Browse files
committedApr 22, 2022
docs(examples): add server bundling example with rollup
Related: #4329
1 parent 1f03a44 commit 06e6838

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed
 
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bundle.js
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Server } from "socket.io";
2+
3+
new Server(0);
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "rollup-server-bundle",
3+
"version": "0.0.1",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"author": "Damien Arrachequesne <damien.arrachequesne@gmail.com>",
8+
"license": "ISC",
9+
"scripts": {
10+
"build": "rollup --config rollup.config.js"
11+
},
12+
"devDependencies": {
13+
"@rollup/plugin-commonjs": "^21.0.3",
14+
"@rollup/plugin-json": "^4.1.0",
15+
"@rollup/plugin-node-resolve": "^13.1.3",
16+
"rollup": "^2.70.1",
17+
"socket.io": "^4.4.1"
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import resolve from "@rollup/plugin-node-resolve";
2+
import commonjs from "@rollup/plugin-commonjs";
3+
import json from "@rollup/plugin-json";
4+
5+
export default {
6+
input: "index.js",
7+
output: {
8+
file: "bundle.js",
9+
format: "esm",
10+
},
11+
plugins: [resolve(), commonjs(), json({ compact: true })],
12+
};

0 commit comments

Comments
 (0)
Please sign in to comment.