build(types): copy .d.ts files from src to types

This commit is contained in:
Eric Liu 2022-03-27 13:04:58 -07:00
commit 613d58cb04
13 changed files with 90 additions and 22 deletions

View file

@ -1,3 +1,5 @@
const fs = require("fs");
const glob = require("glob");
const { sveld } = require("sveld");
const pkg = require("../package.json");
@ -18,3 +20,8 @@ sveld({
outFile: "docs/src/COMPONENT_API.json",
},
});
glob.sync("./src/**/*.d.ts").forEach((file) => {
console.log("Copying", file, " to types/");
fs.copyFileSync(file, file.replace(/src/, "types"));
});