文件操作 - chunk-reload.client.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/nuxt/dist/app/plugins/chunk-reload.client.js
编辑文件内容
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 isHash = "href" in to && to.href[0] === "#"; const path = isHash ? config.app.baseURL + to.href : 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); } }); } });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件