Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
30
Frontend-Learner/node_modules/nuxt/dist/app/plugins/chunk-reload.client.js
generated
vendored
Normal file
30
Frontend-Learner/node_modules/nuxt/dist/app/plugins/chunk-reload.client.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { joinURL } from "ufo";
|
||||
import { defineNuxtPlugin, useRuntimeConfig } from "../nuxt.js";
|
||||
import { useRouter } from "../composables/router.js";
|
||||
import { reloadNuxtApp } from "../composables/chunk.js";
|
||||
export default defineNuxtPlugin({
|
||||
name: "nuxt:chunk-reload",
|
||||
setup(nuxtApp) {
|
||||
const router = useRouter();
|
||||
const config = useRuntimeConfig();
|
||||
const chunkErrors = /* @__PURE__ */ new Set();
|
||||
router.beforeEach(() => {
|
||||
chunkErrors.clear();
|
||||
});
|
||||
nuxtApp.hook("app:chunkError", ({ error }) => {
|
||||
chunkErrors.add(error);
|
||||
});
|
||||
function reloadAppAtPath(to) {
|
||||
const path = joinURL(config.app.baseURL, to.fullPath);
|
||||
reloadNuxtApp({ path, persistState: true });
|
||||
}
|
||||
nuxtApp.hook("app:manifest:update", () => {
|
||||
router.beforeResolve(reloadAppAtPath);
|
||||
});
|
||||
router.onError((error, to) => {
|
||||
if (chunkErrors.has(error)) {
|
||||
reloadAppAtPath(to);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue