-
Notifications
You must be signed in to change notification settings - Fork 6
/
rollup.config.dev.js
68 lines (66 loc) · 2.07 KB
/
rollup.config.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* This bundles only the widget container
*/
import { nodeResolve } from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import { replaceHtml } from "./replace.html.js";
import url from "postcss-url";
import postcss from "rollup-plugin-postcss";
// dependencies which are not bundled
const externalDependencies = [
"yjs",
"https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js",
"https://unpkg.com/jquery@3.6.0/dist/jquery.js",
"https://cdnjs.cloudflare.com/ajax/libs/graphlib/2.1.8/graphlib.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.js",
"https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.4.1/jquery-migrate.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/dagre/0.8.5/dagre.min.js",
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js",
"lit",
"y-websocket",
"y-quill",
"quill",
];
/**
* @type {import('rollup').RollupOptions}
*/
export default [
// widget container
{
plugins: [
replaceHtml(),
typescript(),
postcss({
plugins: [
url({
url: "inline", // enable inline assets using base64 encoding
}),
],
}),
nodeResolve({ browser: true }),
commonjs({
include: [/node_modules/],
extensions: [".js", ".ts"],
}), // makes sure that any commonjs modules are transformed to es6 to be bundled the ".ts" extension is required css(),
],
watch: {
include: "src/**",
},
input: "src/widgets/widget.container.ts",
output: {
file: "build/widgets/widget.container.js",
sourcemap: true,
inlineDynamicImports: true,
format: "es",
globals: {
yjs: "Y",
"y-quill": "QuillBinding",
"y-websocket": "WebsocketProvider",
},
},
external: externalDependencies,
preserveEntrySignatures: "strict",
},
];