improve file structure + add TSX/JSX support
All checks were successful
/ test (push) Successful in 14s

This commit is contained in:
Soph :3 2024-07-23 10:12:54 +03:00
parent 013c7cef7f
commit a7aaff537f
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
13 changed files with 67 additions and 48 deletions

View file

@ -20,12 +20,18 @@ export default class TSCompiler extends Plugin {
const result = await esbuild.build({
stdin: {
contents: file,
resolveDir: filePath.split("/")?.slice(0,-1).join("/"),
sourcefile: filePath.split("/").at(-1),
loader: "ts"
loader: filePath.split("/").at(-1)?.split(".").at(-1) as "ts"|"tsx"|"jsx"
},
jsxFragment: "Fragment",
jsxFactory: "Nano.h",
jsxImportSource: "nano-jsx",
jsx: "transform",
write: false,
bundle: true,
outdir: 'out',
minify: this.minify
minify: this.minify,
});
if(result.errors.length != 0) {