mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Rename NEXT_PAGE_LOADER into __NEXT_PAGE_LOADER__
This commit is contained in:
parent
5aa02d0727
commit
32cdf3f2d0
|
@ -28,7 +28,7 @@ const {
|
||||||
location
|
location
|
||||||
} = window
|
} = window
|
||||||
|
|
||||||
const pageLoader = window.NEXT_PAGE_LOADER = new PageLoader(buildId)
|
const pageLoader = window.__NEXT_PAGE_LOADER__ = new PageLoader(buildId)
|
||||||
if (window.NEXT_LOADED_PAGES) {
|
if (window.NEXT_LOADED_PAGES) {
|
||||||
window.NEXT_LOADED_PAGES.forEach((fn) => fn())
|
window.NEXT_LOADED_PAGES.forEach((fn) => fn())
|
||||||
delete window.NEXT_LOADED_PAGES
|
delete window.NEXT_LOADED_PAGES
|
||||||
|
|
|
@ -18,10 +18,10 @@ export default class PagesPlugin {
|
||||||
const newContent = `
|
const newContent = `
|
||||||
function loadPage () {
|
function loadPage () {
|
||||||
var comp = ${content}
|
var comp = ${content}
|
||||||
window.NEXT_PAGE_LOADER.registerPage('${routeName}', null, comp.default)
|
window.__NEXT_PAGE_LOADER__.registerPage('${routeName}', null, comp.default)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.NEXT_PAGE_LOADER) {
|
if (window.__NEXT_PAGE_LOADER__) {
|
||||||
loadPage()
|
loadPage()
|
||||||
} else {
|
} else {
|
||||||
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
||||||
|
|
|
@ -135,10 +135,10 @@ export async function renderScriptError (req, res, page, error, customFields, op
|
||||||
var error = new Error('Page not exists: ${page}')
|
var error = new Error('Page not exists: ${page}')
|
||||||
error.pageNotFound = true
|
error.pageNotFound = true
|
||||||
error.statusCode = 404
|
error.statusCode = 404
|
||||||
NEXT_PAGE_LOADER.registerPage('${page}', error)
|
__NEXT_PAGE_LOADER__.registerPage('${page}', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.NEXT_PAGE_LOADER) {
|
if (window.__NEXT_PAGE_LOADER__) {
|
||||||
loadPage()
|
loadPage()
|
||||||
} else {
|
} else {
|
||||||
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
||||||
|
@ -157,10 +157,10 @@ export async function renderScriptError (req, res, page, error, customFields, op
|
||||||
res.end(`
|
res.end(`
|
||||||
function loadPage () {
|
function loadPage () {
|
||||||
var error = ${JSON.stringify(errorJson)}
|
var error = ${JSON.stringify(errorJson)}
|
||||||
NEXT_PAGE_LOADER.registerPage('${page}', error)
|
__NEXT_PAGE_LOADER__.registerPage('${page}', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.NEXT_PAGE_LOADER) {
|
if (window.__NEXT_PAGE_LOADER__) {
|
||||||
loadPage()
|
loadPage()
|
||||||
} else {
|
} else {
|
||||||
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
|
||||||
|
|
Loading…
Reference in a new issue