From 96c3d483f76b7b1e58a3d94638d4cb33e36c38ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez=20Rinc=C3=B3n?= Date: Thu, 6 Jun 2024 01:06:02 +0200 Subject: [PATCH] fix: do not assume encoding and only patch js files --- forge.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge.config.js b/forge.config.js index 27356fd..bd9c872 100644 --- a/forge.config.js +++ b/forge.config.js @@ -48,7 +48,7 @@ async function setEnhancerMainField(buildPath) { async function patchFile(enhancerPatcher, buildPath, file) { const filePath = path.join(buildPath, file) - const contents = await fs.readFile(filePath, 'utf-8') + const contents = await fs.readFile(filePath) const patchedContents = enhancerPatcher(file, contents) if (contents === patchedContents) { @@ -67,7 +67,7 @@ async function patchAllFiles(buildPath) { console.log('Enhancer patcher:', enhancerPatcher) - const files = await glob('**/*', { + const files = await glob('**/*.js', { cwd: buildPath, posix: true, nodir: true,