We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 708a074 commit d8ab0f1Copy full SHA for d8ab0f1
packages/next/src/build/webpack/loaders/next-flight-action-entry-loader.ts
@@ -22,12 +22,15 @@ function nextFlightActionEntryLoader(this: any) {
22
return `
23
${individualActions
24
.map(([_, path]) => {
25
+ // This import ensures that the module is always bundled even if there's no
26
+ // explicit import in the codebase, to avoid the action being DCE'd.
27
return `import(/* webpackMode: "eager" */ ${JSON.stringify(path)});`
28
})
29
.join('\n')}
30
31
32
.map(([id, path, name]) => {
33
+ // Re-export the same functions from the original module path as action IDs.
34
return `export { ${name} as "${id}" } from ${JSON.stringify(path)}`
35
36
0 commit comments