From 6fb291112dae0782502b9095eeb818cc61a077c2 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 13 Mar 2024 13:01:25 +0000 Subject: [PATCH] Update TeaVM for ESM support We still need our fork (file attributes, some Math/Int/Long methods), but this simplifies things a wee bit. --- gradle/libs.versions.toml | 2 +- .../web/src/builder/java/cc/tweaked/web/builder/Builder.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index efdd5c5fb..06f9a2f01 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -72,7 +72,7 @@ mixinGradle = "0.7.38" nullAway = "0.9.9" spotless = "6.23.3" taskTree = "2.1.1" -teavm = "0.10.0-SQUID.2" +teavm = "0.10.0-SQUID.3" vanillaExtract = "0.1.1" versionCatalogUpdate = "0.8.1" diff --git a/projects/web/src/builder/java/cc/tweaked/web/builder/Builder.java b/projects/web/src/builder/java/cc/tweaked/web/builder/Builder.java index 37687ffc3..6bcc97038 100644 --- a/projects/web/src/builder/java/cc/tweaked/web/builder/Builder.java +++ b/projects/web/src/builder/java/cc/tweaked/web/builder/Builder.java @@ -4,6 +4,7 @@ package cc.tweaked.web.builder; +import org.teavm.backend.javascript.JSModuleType; import org.teavm.common.JsonUtil; import org.teavm.tooling.ConsoleTeaVMToolLog; import org.teavm.tooling.TeaVMProblemRenderer; @@ -71,6 +72,7 @@ public class Builder { // Then finally start the compiler! var tool = new TeaVMTool(); tool.setTargetType(TeaVMTargetType.JAVASCRIPT); + tool.setJsModuleType(JSModuleType.ES2015); tool.setTargetDirectory(output.toFile()); tool.setClassLoader(remapper); tool.setMainClass("cc.tweaked.web.Main");