Make Non-HTML Pages work for static build (#2638)
* Make Non-HTML Pages work for static build * Check hasOwnProperty instead of length * Fix typo "> 0"
This commit is contained in:
parent
ad3f3cf41d
commit
f165b78ad2
1 changed files with 2 additions and 2 deletions
|
@ -50,10 +50,10 @@ export async function render(renderers: Renderer[], mod: ComponentInstance, ssrO
|
|||
const { astroConfig, filePath, logging, mode, origin, pathname, route, routeCache, viteServer } = ssrOpts;
|
||||
|
||||
// Add hoisted script tags
|
||||
const scripts = createModuleScriptElementWithSrcSet(astroConfig.buildOptions.experimentalStaticBuild ? Array.from(mod.$$metadata.hoistedScriptPaths()) : []);
|
||||
const scripts = createModuleScriptElementWithSrcSet(astroConfig.buildOptions.experimentalStaticBuild && mod.hasOwnProperty('$$metadata') ? Array.from(mod.$$metadata.hoistedScriptPaths()) : []);
|
||||
|
||||
// Inject HMR scripts
|
||||
if (mode === 'development' && astroConfig.buildOptions.experimentalStaticBuild) {
|
||||
if (mod.hasOwnProperty('$$metadata') && mode === 'development' && astroConfig.buildOptions.experimentalStaticBuild) {
|
||||
scripts.add({
|
||||
props: { type: 'module', src: '/@vite/client' },
|
||||
children: '',
|
||||
|
|
Loading…
Reference in a new issue