-
Notifications
You must be signed in to change notification settings - Fork 16
/
rollup.config.js
33 lines (30 loc) · 863 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
33
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import svelte from "rollup-plugin-svelte";
import svelteReadme from "svelte-readme";
import pkg from "./package.json";
export default () => {
if (!process.env.BUNDLE) {
return svelteReadme({
plugins: [commonjs()],
style: `
.code-fence li + li { margin: 0; }
.code-fence { min-height: 16rem; }
.code-fence pre { margin-bottom: 0; margin-top: 12px; }
`,
});
}
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({ emitCss: false }), resolve(), commonjs()],
};
});
};