feat: do not include redundant metadata
This commit is contained in:
parent
c70396e72d
commit
5628e62194
1 changed files with 10 additions and 5 deletions
|
@ -155,7 +155,7 @@ export async function generateHydrateScript(
|
||||||
|
|
||||||
// Add renderer url
|
// Add renderer url
|
||||||
if (renderer.clientEntrypoint) {
|
if (renderer.clientEntrypoint) {
|
||||||
scriptProps['componentExport'] = componentExport.value;
|
if (componentExport.value !== 'default') scriptProps['componentExport'] = componentExport.value;
|
||||||
scriptProps['rendererUrl'] = await result.resolve(decodeURI(renderer.clientEntrypoint));
|
scriptProps['rendererUrl'] = await result.resolve(decodeURI(renderer.clientEntrypoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +165,16 @@ export async function generateHydrateScript(
|
||||||
if (beforeHydrationUrl.length) {
|
if (beforeHydrationUrl.length) {
|
||||||
scriptProps['beforeHydrationUrl'] = beforeHydrationUrl;
|
scriptProps['beforeHydrationUrl'] = beforeHydrationUrl;
|
||||||
}
|
}
|
||||||
scriptProps['opts'] = {
|
scriptProps['opts'] = {};
|
||||||
name: metadata.displayName,
|
if (metadata.displayName) {
|
||||||
value: metadata.hydrateArgs || '',
|
scriptProps.opts.name = metadata.displayName;
|
||||||
|
}
|
||||||
|
if (metadata.hydrateArgs !== true) {
|
||||||
|
scriptProps.opts.value = metadata.hydrateArgs;
|
||||||
|
}
|
||||||
|
if (typeof props === 'object' && Object.keys(props).length > 0) {
|
||||||
|
scriptProps['props'] = props;
|
||||||
}
|
}
|
||||||
scriptProps['props'] = props;
|
|
||||||
|
|
||||||
transitionDirectivesToCopyOnIsland.forEach((name) => {
|
transitionDirectivesToCopyOnIsland.forEach((name) => {
|
||||||
if (props[name]) {
|
if (props[name]) {
|
||||||
|
|
Loading…
Reference in a new issue