Skip to content

Commit

Permalink
fix(hydrate): resourcesUrl is an actual URL
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 16, 2019
1 parent b9325de commit 3cf39fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/compiler/copy/hashed-copy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import * as d from '../../declarations';

/www/build/app.css

export async function generateHashedCopy(config: d.Config, compilerCtx: d.CompilerCtx, path: string) {
try {
const content = await compilerCtx.fs.readFile(path);
Expand Down
1 change: 1 addition & 0 deletions src/declarations/hydrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface HydrateDocumentOptions {
referrer?: string;
removeScripts?: boolean;
removeUnusedStyles?: boolean;
resourcesUrl?: string;
timeout?: number;
title?: string;
url?: string;
Expand Down
4 changes: 3 additions & 1 deletion src/hydrate/platform/bootstrap-hydrate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as d from '../../declarations';
import { getComponent, getHostRef } from '@platform';
import { getComponent, getHostRef, plt } from '@platform';
import { hydrateComponent } from './hydrate-component';
import { insertVdomAnnotations, postUpdateComponent } from '@runtime';

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


try {
const connectedElements = new Set<any>();
Expand Down

0 comments on commit 3cf39fd

Please sign in to comment.