forked from carbon-design-system/sveld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
32 lines (30 loc) · 836 Bytes
/
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
import pkg from "./package.json";
import svelte from "rollup-plugin-svelte";
import resolve from "@rollup/plugin-node-resolve";
import sveld from "sveld";
const production = !process.env.ROLLUP_WATCH;
export default {
input: "src",
output: { format: "es", file: pkg.module },
plugins: [
svelte(),
resolve(),
production &&
sveld({
typesOptions: {
preamble: `// TypeScript definitions for ${pkg.name}@${pkg.version}\n\n`,
},
markdown: true,
markdownOptions: {
onAppend: (type, document, components) => {
if (type === "h1")
document.append(
"quote",
`${components.size} components exported from ${pkg.name}@${pkg.version}.`
);
},
},
json: true,
}),
],
};