Skip to content

Commit

Permalink
Merged in fix-preload-prefetch (pull request #35)
Browse files Browse the repository at this point in the history
Use full bundle url in preload and prefetch loaders

Approved-by: Will Binns-Smith
  • Loading branch information
padmaia committed Apr 14, 2020
2 parents 2b42eb4 + 9efe5cc commit afca002
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/runtimes/js/src/JSRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ function getLoaderRuntimes({
let preloadCode = bundlesToPreload
.map(
preloadBundle =>
`require('./loaders/browser/preload-loader')(${getRelativePathExpr(
bundle,
preloadBundle,
)});`,
`require('./loaders/browser/preload-loader')(
require('./bundle-url').getBundleURL() +
${getRelativePathExpr(bundle, preloadBundle)}
);`,
)
.join();

Expand Down Expand Up @@ -295,10 +295,10 @@ function getLoaderRuntimes({
if (externalBundle.pipeline === 'prefetch') {
assets.push({
filePath: __filename,
code: `require('./loaders/browser/prefetch-loader')(${getRelativePathExpr(
bundle,
externalBundle,
)})`,
code: `require('./loaders/browser/prefetch-loader')(
require('./bundle-url').getBundleURL() +
${getRelativePathExpr(bundle, externalBundle)}
)`,
isEntry: true,
});
}
Expand Down

0 comments on commit afca002

Please sign in to comment.