From 3e631662430aed86ee4c402f905964878a1fc292 Mon Sep 17 00:00:00 2001 From: Samuel Stroschein <35429197+samuelstroschein@users.noreply.github.com> Date: Tue, 13 Jun 2023 22:21:34 +0200 Subject: [PATCH] refactor: set platform to browser instead of neutral /"neutral" leads to errors if an npm module does not have an "exports" field see https://github.com/Chevrotain/chevrotain/issues/1941 . also typescript itself is not compatible with "neutral" --- source-code/core/src/plugin/pluginBuildConfig.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source-code/core/src/plugin/pluginBuildConfig.ts b/source-code/core/src/plugin/pluginBuildConfig.ts index 5a945a4e01..9040a3af5d 100644 --- a/source-code/core/src/plugin/pluginBuildConfig.ts +++ b/source-code/core/src/plugin/pluginBuildConfig.ts @@ -64,7 +64,10 @@ export async function pluginBuildConfig( // ------------ STATIC OPTIONS ------------ ops.bundle = true - ops.platform = "neutral" + //! "neutral" leads to errors if an npm module does not have an "exports" field + //! see https://github.com/Chevrotain/chevrotain/issues/1941 + //! also typescript itself is not compatible with "neutral" + ops.platform = "browser" ops.format = "esm" // es2020 in anticipation of sandboxing JS with QuickJS in the near future ops.target = "es2020"