From 5949bb6c7fec5616e9d3f9ba21eb1ab1b41ed905 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 5 Apr 2025 08:46:17 +0900 Subject: fix: unnecesary HMR when we opened setting page (#15756) * refactor: add MarkerIdAssigner instead of processVueFile and remove transformedCodeCache object * chore: add minimatch, a glob matcher * chore: expose MarkerIdAssigner from plugin * Revert "chore: expose MarkerIdAssigner from plugin" This reverts commit 88c6d820f8635c35f1c15b4aac0987075d7cf8aa. * chore: add plugin to generate virtual module * chore: parse inlining earlier * chore: use virtual module in search * chore: use remove old generation * chore: fix type errors * chore: add patch to workaround vitejs/vite#19792 * chore: improve filtering files to process * chore: rename plugin * docs: add comment for plugin ordering * fix: unnecessary log * fix: spdx license header --- scripts/dependency-patches/vite.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/dependency-patches/vite.patch (limited to 'scripts') diff --git a/scripts/dependency-patches/vite.patch b/scripts/dependency-patches/vite.patch new file mode 100644 index 0000000000..3fe28ea67e --- /dev/null +++ b/scripts/dependency-patches/vite.patch @@ -0,0 +1,31 @@ +diff --git a/dist/node/chunks/dep-DrOo5SEf.js b/dist/node/chunks/dep-DrOo5SEf.js +index 329e68bd27e55a56d815fa6b4de2d615a8c2b343..9d9f58e90ae836f80063b698e307fec436e53e07 100644 +--- a/dist/node/chunks/dep-DrOo5SEf.js ++++ b/dist/node/chunks/dep-DrOo5SEf.js +@@ -45971,7 +45971,7 @@ function importAnalysisPlugin(config) { + let isPartiallySelfAccepting = false; + const importedBindings = enablePartialAccept ? /* @__PURE__ */ new Map() : null; + const toAbsoluteUrl = (url) => path$d.posix.resolve(path$d.posix.dirname(importerModule.url), url); +- const normalizeUrl = async (url, pos, forceSkipImportAnalysis = false) => { ++ const normalizeUrl = async (url, pos, forceSkipImportAnalysis = false, stripBase2 = false) => { + url = stripBase(url, base); + let importerFile = importer; + if (depsOptimizer && moduleListContains(depsOptimizer.options.exclude, url)) { +@@ -46031,7 +46031,7 @@ function importAnalysisPlugin(config) { + e.pos = pos; + throw e; + } +- if (!ssr) url = joinUrlSegments(base, url); ++ if (!ssr && !stripBase2) url = joinUrlSegments(base, url); + return [url, resolved.id]; + }; + const orderedImportedUrls = new Array(imports.length); +@@ -46288,7 +46288,7 @@ See ${colors$1.blue( + const pluginImports = this._addedImports; + if (pluginImports) { + (await Promise.all( +- [...pluginImports].map((id) => normalizeUrl(id, 0, true)) ++ [...pluginImports].map((id) => normalizeUrl(id, 0, true, true)) + )).forEach(([url]) => importedUrls.add(url)); + } + if (ssr && importerModule.isSelfAccepting) { -- cgit v1.2.3-freya