Skip to content

Commit

Permalink
Improve serverEntrypoint codegen (#12566)
Browse files Browse the repository at this point in the history
* Remove fileurl handling

* fix
  • Loading branch information
bluwy authored Dec 4, 2024
1 parent 62939ad commit 29bcdf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/plugins/plugin-renderers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function vitePluginRenderers(opts: StaticBuildOptions): VitePlugin {

for (const renderer of opts.settings.renderers) {
const variable = `_renderer${i}`;
imports.push(`import ${variable} from '${renderer.serverEntrypoint}';`);
imports.push(`import ${variable} from ${JSON.stringify(renderer.serverEntrypoint)};`);
rendererItems += `Object.assign(${JSON.stringify(renderer)}, { ssr: ${variable} }),`;
i++;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/plugins/plugin-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function vitePluginAdapter(adapter: AstroAdapter): VitePlugin {
},
async load(id) {
if (id === RESOLVED_ADAPTER_VIRTUAL_MODULE_ID) {
return `export * from '${adapter.serverEntrypoint}';`;
return `export * from ${JSON.stringify(adapter.serverEntrypoint)};`;
}
},
};
Expand Down

0 comments on commit 29bcdf5

Please sign in to comment.