Commit 8dd394a0 authored by Ilya's avatar Ilya Committed by Joe Haddad

Load granular chunks with correct asset prefix (#8993)

* closes #8989

fix

closes #8989

* test

* Update next.config.js

* Revert page1.js

* Revert page2.js

* Delete page4.js

* Delete page3.js

* Update index.test.js

* Revert index.test.js

* Revert next.config.js
parent f632567b
...@@ -187,11 +187,13 @@ export default class PageLoader { ...@@ -187,11 +187,13 @@ export default class PageLoader {
) { ) {
scriptRoute = scriptRoute.replace(/\.js$/, '.module.js') scriptRoute = scriptRoute.replace(/\.js$/, '.module.js')
} }
const url = isDependency const url =
? route this.assetPrefix +
: `${this.assetPrefix}/_next/static/${encodeURIComponent( (isDependency
this.buildId ? route
)}/pages${scriptRoute}` : `/_next/static/${encodeURIComponent(
this.buildId
)}/pages${scriptRoute}`)
// n.b. If preload is not supported, we fall back to `loadPage` which has // n.b. If preload is not supported, we fall back to `loadPage` which has
// its own deduping mechanism. // its own deduping mechanism.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment