-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.config.js
63 lines (54 loc) · 1.37 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
import resolve from "@rollup/plugin-node-resolve";
import svelte from "rollup-plugin-svelte";
import svelteReadme from "svelte-readme";
import pkg from "./package.json";
export default () => {
if (!process.env.BUNDLE) {
return svelteReadme({
style: `
.code-fence ul { padding: 0; }
.code-fence li+li {
margin-top: 0;
}
.code-fence button {
border-radius: 0;
}
[data-accordion] {
list-style: none;
}
[data-accordion-item] button {
border: 0;
border-bottom: 1px solid #e0e0e0;
background: none;
font: inherit;
line-height: inherit;
color: inherit;
cursor: pointer;
padding: 0.5rem 1rem;
width: 100%;
text-align: left;
}
[data-accordion-item] button[disabled] {
opacity: 0.5;
cursor: not-allowed;
}
[data-accordion-item] [role="region"] {
padding: 1rem;
}
`,
});
}
return ["es", "umd"].map((format) => {
const UMD = format === "umd";
return {
input: pkg.svelte,
output: {
format,
file: UMD ? pkg.main : pkg.module,
name: UMD ? pkg.name : undefined,
exports: "named",
},
plugins: [svelte(), resolve()],
};
});
};