Skip to content

Commit

Permalink
Read the controllers.json as string rather than Buffer
Browse files Browse the repository at this point in the history
Buffers can implicitly be converted to string (implicitly using `utf8`
as encoding) but the type checker does not like this kind of implicit
conversion.
When passing an encoding to `fs.readFileSync`, it returns a string by
performing an explicit conversion using the provided encoding.
  • Loading branch information
stof committed Sep 5, 2024
1 parent 2b10db0 commit 7760cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ class WebpackConfig {
}

// Add configured entrypoints
const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath));
const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath, 'utf8'));
const rootDir = path.dirname(path.resolve(controllerJsonPath));

for (let name in controllersData.entrypoints) {
Expand Down

0 comments on commit 7760cea

Please sign in to comment.