Refactor(compiler): Change esbuild transform and compile target to es2015

This commit is contained in:
2024-10-26 18:26:27 +08:00
parent d340a427a8
commit 030ba1c9bb

View File

@@ -58,7 +58,7 @@ class Compiler {
transform = async (code: string, loader: Loader) => {
await this.waitInit()
return esbuild.transform(code, { loader })
return esbuild.transform(code, { loader, target: 'es2015' })
}
compile = async (files: IFiles, importMap: IImportMap, entryPoint: string) => {
@@ -67,6 +67,7 @@ class Compiler {
bundle: true,
entryPoints: [entryPoint],
format: 'esm',
target: 'es2015',
metafile: true,
write: false,
plugins: [this.fileResolverPlugin(files, importMap)]