Merge pull request #7 from ryoppippi/dev/add-vue-and-svelte

add svelte and vue support
This commit is contained in:
Barrett Ruth 2023-01-11 19:02:16 -06:00 committed by GitHub
commit 64e55a22ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,9 +14,16 @@ const receive = async () => {
const give = (data) =>
process.nextTick(() => process.stdout.write(`${JSON.stringify(data)}|`));
const filetypes = new Map([
["j", Lang.JAVASCRIPT],
["s", Lang.SVELTE],
["t", Lang.TYPESCRIPT],
["v", Lang.VUE],
]);
const init = async () => {
const [path, filetype] = process.argv.slice(2);
const lang = filetype[0] === "t" ? Lang.TYPESCRIPT : Lang.JAVASCRIPT;
const lang = filetypes.get(filetype[0]);
const contents = await receive();
const emitter = importCost(path, contents, lang);