Skip to content

Commit

Permalink
fix(gatsby): support builtin modules prefixed with node: on `build-…
Browse files Browse the repository at this point in the history
…html` (#38516)
  • Loading branch information
chitoku-k authored Jan 3, 2024
1 parent c681a9e commit a08c8a0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,17 @@ module.exports = async (
const builtinsExternalsDictionary = builtinModules.reduce(
(acc, builtinModule) => {
if (builtinModulesToTrack.includes(builtinModule)) {
acc[builtinModule] = `commonjs ${path.join(
const builtinModuleTracked = path.join(
program.directory,
`.cache`,
`ssr-builtin-trackers`,
builtinModule
)}`
)
acc[builtinModule] = `commonjs ${builtinModuleTracked}`
acc[`node:${builtinModule}`] = `commonjs ${builtinModuleTracked}`
} else {
acc[builtinModule] = `commonjs ${builtinModule}`
acc[`node:${builtinModule}`] = `commonjs ${builtinModule}`
}
return acc
},
Expand Down

0 comments on commit a08c8a0

Please sign in to comment.