From 6a0768b490c01b21b3f0e6aa62b8c4768975f04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Tue, 26 Mar 2024 14:45:03 +0100 Subject: [PATCH] :bug: Fix helper to compile polyfills --- frontend/scripts/_helpers.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/scripts/_helpers.js b/frontend/scripts/_helpers.js index b086ce5ec..cb2d36ac9 100644 --- a/frontend/scripts/_helpers.js +++ b/frontend/scripts/_helpers.js @@ -32,7 +32,6 @@ async function findFiles(basePath, predicate, options={}) { predicate = predicate ?? function() { return true; } let files = await fs.readdir(basePath, {recursive: options.recursive ?? false}) - files = files.filter((path) => path.endsWith(".svg")); files = files.map((path) => ph.join(basePath, path)); return files; @@ -54,7 +53,11 @@ export function isSassFile(path) { } export function isSvgFile(path) { - return path.endsWith(".scss"); + return path.endsWith(".svg"); +} + +export function isJsFile(path) { + return path.endsWith(".js"); } export async function compileSass(worker, path, options) { @@ -378,7 +381,7 @@ export async function compilePolyfills() { log.info("init: compile polyfills") - const files = await findFiles("resources/polyfills/"); + const files = await findFiles("resources/polyfills/", isJsFile); let result = []; for (let path of files) { const content = await fs.readFile(path, {encoding:"utf-8"});