Add a negative lookahead to prevent .json to be changed (#3536)

This was breaking the REST manager as the fetch() Response object uses a .json method to get the JSON body
This commit is contained in:
Fleny
2024-04-18 11:06:55 +02:00
committed by GitHub
parent 169d35b55b
commit 06e8ec3888

View File

@@ -10,7 +10,7 @@ for await (const dir of dirs) {
}
const content = await fs.promises.readFile(`dist/cjs${dir}/${file}`, 'utf-8')
await fs.promises.rm(`dist/cjs${dir}/${file}`)
fs.promises.writeFile(`dist/cjs${dir}/${file.slice(0, -3)}.cjs`, content.replace(/\.js/g, '.cjs'))
fs.promises.writeFile(`dist/cjs${dir}/${file.slice(0, -3)}.cjs`, content.replace(/\.js(?!on)/g, '.cjs'))
}),
)
}