-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
69 lines (65 loc) · 1.36 KB
/
rollup.config.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
69
import buble from "rollup-plugin-buble"
import nodeResolve from "rollup-plugin-node-resolve"
import commonJS from "rollup-plugin-commonjs"
const commonJsPlugin = commonJS({
include: 'node_modules/**',
sourceMap: false
})
const browserPlugins = [
buble({
exclude: "node_modules/**",
namedFunctionExpressions: false
}),
nodeResolve({
main: true,
browser: true
}),
commonJsPlugin
]
const nodePlugins = [
buble({
exclude: "node_modules/**",
target: { node: 4 },
transforms: { arrow: true } // Work around https://gitlab.com/Rich-Harris/buble/issues/187
}),
nodeResolve({
main: true
}),
commonJsPlugin
]
export default [
{
input: "src/collab/client/startpage.js",
output: {
file: "public/js/startpage.js",
format: "iife"
},
plugins: browserPlugins
},
{
input: "src/collab/client/fullpage.js",
output: {
file: "public/js/fullpage.js",
format: "iife"
},
plugins: browserPlugins
},
{
input: "src/collab/server/start.js",
output: {
file: "lib/server.js",
format: "cjs"
},
plugins: nodePlugins,
external: ["crypto", "events", "url", "fs", "path", "http"]
},
{
input: "src/build/build.js",
output: {
file: "lib/build.js",
format: "cjs"
},
plugins: nodePlugins,
external: ["url", "fs", "path", "http"]
}
]