create project
This commit is contained in:
51
kitabcitab/node_modules/next/dist/esm/client/app-bootstrap.js
generated
vendored
Normal file
51
kitabcitab/node_modules/next/dist/esm/client/app-bootstrap.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Before starting the Next.js runtime and requiring any module, we need to make
|
||||
* sure the following scripts are executed in the correct order:
|
||||
* - Polyfills
|
||||
* - next/script with `beforeInteractive` strategy
|
||||
*/ const version = "13.1.1";
|
||||
window.next = {
|
||||
version,
|
||||
appDir: true
|
||||
};
|
||||
function loadScriptsInSequence(scripts, hydrate) {
|
||||
if (!scripts || !scripts.length) {
|
||||
return hydrate();
|
||||
}
|
||||
return scripts.reduce((promise, [src, props])=>{
|
||||
return promise.then(()=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
const el = document.createElement('script');
|
||||
if (props) {
|
||||
for(const key in props){
|
||||
if (key !== 'children') {
|
||||
el.setAttribute(key, props[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (src) {
|
||||
el.src = src;
|
||||
el.onload = resolve;
|
||||
el.onerror = reject;
|
||||
} else if (props) {
|
||||
el.innerHTML = props.children;
|
||||
setTimeout(resolve);
|
||||
}
|
||||
document.head.appendChild(el);
|
||||
});
|
||||
});
|
||||
}, Promise.resolve()).then(()=>{
|
||||
hydrate();
|
||||
}).catch((err)=>{
|
||||
console.error(err);
|
||||
// Still try to hydrate even if there's an error.
|
||||
hydrate();
|
||||
});
|
||||
}
|
||||
export function appBootstrap(callback) {
|
||||
loadScriptsInSequence(self.__next_s, ()=>{
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-bootstrap.js.map
|
||||
Reference in New Issue
Block a user