From 28c5b0b80e3caccb8d6b2082fac393c6de438f3f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 24 Jun 2021 16:55:22 +0200 Subject: [PATCH] need side-effects for polyfills --- scripts/build.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index 040d9c69..d83acc4c 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -47,7 +47,17 @@ const __dirname = dirname(__filename); const projectDir = path.join(__dirname, "../"); const cssSrcDir = path.join(projectDir, "src/platform/web/ui/css/"); const srcDir = path.join(projectDir, "src/"); -const isPathInSrcDir = path => path.startsWith(srcDir); + +const allowSideEffectsTreeShakeDirs = [ + path.join(projectDir, "node_modules/mdn-polyfills/"), + path.join(projectDir, "node_modules/core-js/"), + path.join(projectDir, "node_modules/text-encoding/"), + srcDir, +]; + +const isPathInSrcDir = path => { + return allowSideEffectsTreeShakeDirs.some(p => path.startsWith(p)); +}; const parameters = new commander.Command(); parameters