Skip to content

Commit 3cf39fd

Browse files
committed
fix(hydrate): resourcesUrl is an actual URL
1 parent b9325de commit 3cf39fd

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/compiler/copy/hashed-copy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as d from '../../declarations';
22

3-
/www/build/app.css
4-
53
export async function generateHashedCopy(config: d.Config, compilerCtx: d.CompilerCtx, path: string) {
64
try {
75
const content = await compilerCtx.fs.readFile(path);

src/declarations/hydrate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface HydrateDocumentOptions {
2525
referrer?: string;
2626
removeScripts?: boolean;
2727
removeUnusedStyles?: boolean;
28+
resourcesUrl?: string;
2829
timeout?: number;
2930
title?: string;
3031
url?: string;

src/hydrate/platform/bootstrap-hydrate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as d from '../../declarations';
2-
import { getComponent, getHostRef } from '@platform';
2+
import { getComponent, getHostRef, plt } from '@platform';
33
import { hydrateComponent } from './hydrate-component';
44
import { insertVdomAnnotations, postUpdateComponent } from '@runtime';
55

@@ -9,6 +9,8 @@ export function bootstrapHydrate(win: Window, opts: d.HydrateDocumentOptions, do
99
hydratedCount: 0,
1010
hydratedTags: []
1111
};
12+
plt.$resourcesUrl$ = new URL(opts.resourcesUrl || '/', win.location.href).href;
13+
1214

1315
try {
1416
const connectedElements = new Set<any>();

0 commit comments

Comments
 (0)