Skip to content

Commit d8ab0f1

Browse files
committed
add comment
1 parent 708a074 commit d8ab0f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/next/src/build/webpack/loaders/next-flight-action-entry-loader.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ function nextFlightActionEntryLoader(this: any) {
2222
return `
2323
${individualActions
2424
.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.
2527
return `import(/* webpackMode: "eager" */ ${JSON.stringify(path)});`
2628
})
2729
.join('\n')}
2830
2931
${individualActions
3032
.map(([id, path, name]) => {
33+
// Re-export the same functions from the original module path as action IDs.
3134
return `export { ${name} as "${id}" } from ${JSON.stringify(path)}`
3235
})
3336
.join('\n')}

0 commit comments

Comments
 (0)