Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load granular chunks with correct asset prefix #8993

Merged
merged 13 commits into from
Oct 30, 2019
12 changes: 7 additions & 5 deletions packages/next/client/page-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ export default class PageLoader {
) {
scriptRoute = scriptRoute.replace(/\.js$/, '.module.js')
}
const url = isDependency
? route
: `${this.assetPrefix}/_next/static/${encodeURIComponent(
this.buildId
)}/pages${scriptRoute}`
const url =
this.assetPrefix +
(isDependency
? route
: `/_next/static/${encodeURIComponent(
this.buildId
)}/pages${scriptRoute}`)

// n.b. If preload is not supported, we fall back to `loadPage` which has
// its own deduping mechanism.
Expand Down