Skip to content

Commit

Permalink
fix: do not assume encoding and only patch js files
Browse files Browse the repository at this point in the history
  • Loading branch information
jamezrin committed Jun 5, 2024
1 parent 9a63fa5 commit 96c3d48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 96c3d48

Please sign in to comment.