build: separate sveld into a separate build script

This commit is contained in:
Eric Liu 2022-01-22 12:48:56 -08:00
commit 28fd09f0c9
3 changed files with 21 additions and 19 deletions

View file

@ -3,7 +3,6 @@ import pkg from "./package.json";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import svelte from "rollup-plugin-svelte";
import sveld from "sveld";
export default ["es", "umd"].map((format) => {
const UMD = format === "umd";
@ -23,24 +22,6 @@ export default ["es", "umd"].map((format) => {
resolve(),
commonjs(),
UMD && terser(),
UMD &&
sveld({
glob: true,
markdown: true,
markdownOptions: {
onAppend: (type, document, components) => {
if (type === "h1")
document.append(
"quote",
`${components.size} components exported from ${pkg.name}@${pkg.version}.`
);
},
},
json: true,
jsonOptions: {
outFile: "docs/src/COMPONENT_API.json",
},
}),
],
};
});