-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
75 lines (72 loc) · 1.67 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
70
71
72
73
74
75
const commonjs = require('@rollup/plugin-commonjs');
const riot = require('rollup-plugin-riot');
const typescript = require('rollup-plugin-ts');
const {nodeResolve} = require("@rollup/plugin-node-resolve");
const basicGlobals = {
"riot": "riot"
};
const basicExternal = Object.keys(basicGlobals);
const globals = {
...basicGlobals,
"history-manager": "historyManager"
};
const external = Object.keys(globals);
export default [
{
input: "src/index.ts",
external,
plugins: [
nodeResolve(),
typescript(),
commonjs(),
riot()
],
output: [
{
name: "riotHistoryManager",
file: "dist/index.js",
format: "umd",
globals
},
{
file: "dist/index.es.js",
format: "es"
}
]
},
{
input: "src/index.ts",
external: basicExternal,
plugins: [
nodeResolve(),
typescript(),
commonjs(),
riot()
],
output: [
{
name: "riotHistoryManager",
file: "dist/index+libs.js",
format: "umd",
globals: basicGlobals
},
{
file: "dist/index.es+libs.js",
format: "es"
}
]
},
{
input: "test/src/index.js",
plugins: [
nodeResolve(),
commonjs(),
typescript(),
riot()
],
output: {
dir: "test/scripts",
format: "amd"
}
}
];