Open malerba118 opened 5 years ago
Something along the lines of
import * as ts from "typescript";
const source = "let x: string = 'string'";
let result = ts.transpileModule(source, { compilerOptions: { module: ts.ModuleKind.CommonJS } });
window.alert(JSON.stringify(result));
Might want to make this a peer dependency/plugin option to reduce bundle size
Something along the lines of
import * as ts from "typescript";
const source = "let x: string = 'string'";
let result = ts.transpileModule(source, { compilerOptions: { module: ts.ModuleKind.CommonJS } });
window.alert(JSON.stringify(result));
Might want to make this a peer dependency/plugin option to reduce bundle size