Skip to content

Commit

Permalink
Update packages/@lwc/ssr-compiler/src/compile-js/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Dec 16, 2024
1 parent 171e978 commit 1ca0076
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/@lwc/ssr-compiler/src/compile-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const visitors: Visitors = {
},
Program: {
leave(path, state) {
// After parsing the whole tree, insert needed imports
const importDeclarations = state.importManager.getImportDeclarations();
if (importDeclarations.length > 0) {
path.node?.body.unshift(...importDeclarations);
Expand Down

0 comments on commit 1ca0076

Please sign in to comment.