add svelte and vue support

This commit is contained in:
ryoppippi 2023-01-10 16:04:35 +09:00
parent ef5d25e843
commit f317a6c2eb
No known key found for this signature in database
GPG key ID: 308FE3760BEB0452

View file

@ -16,7 +16,12 @@ const give = (data) =>
const init = async () => {
const [path, filetype] = process.argv.slice(2);
const lang = filetype[0] === "t" ? Lang.TYPESCRIPT : Lang.JAVASCRIPT;
const lang = (() => {
if (filetype === "svelte") return Lang.SVELTE;
if (filetype === "vue") return Lang.VUE;
if (filetype[0] === "t") return Lang.TYPESCRIPT;
return Lang.JAVASCRIPT;
})();
const contents = await receive();
const emitter = importCost(path, contents, lang);