Skip to content

Commit

Permalink
Fix next env vars injection in dynamic (#28309)
Browse files Browse the repository at this point in the history
* Treat `next/dynamic` as non external modules
* add feature flags to webpack cache version
  • Loading branch information
huozhi committed Aug 20, 2021
1 parent a9c1bd7 commit b74ffff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -742,7 +742,7 @@ export default async function getBaseWebpackConfig(
}

const notExternalModules =
/^(?:private-next-pages\/|next\/(?:dist\/pages\/|(?:app|document|link|image|constants)$)|string-hash$)/
/^(?:private-next-pages\/|next\/(?:dist\/pages\/|(?:app|document|link|image|constants|dynamic)$)|string-hash$)/
if (notExternalModules.test(request)) {
return
}
Expand Down Expand Up @@ -1490,6 +1490,8 @@ export default async function getBaseWebpackConfig(
reactProductionProfiling,
webpack: !!config.webpack,
hasRewrites,
reactRoot: config.experimental.reactRoot,
concurrentFeatures: config.experimental.concurrentFeatures,
})

const cache: any = {
Expand Down

0 comments on commit b74ffff

Please sign in to comment.