@sveltejs/vite-plugin-svelte 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -39,18 +39,24 @@ export function loadCompiledCss(api) {
|
|
|
39
39
|
if (!svelteRequest) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
|
|
43
|
+
let cachedCss = this.getModuleInfo(svelteRequest.filename)?.meta.svelte?.css;
|
|
44
|
+
if (!cachedCss) {
|
|
45
|
+
// some module IDs have a ?v=... query string suffix in addition to the
|
|
46
|
+
// filename. We can retrieve this by running resolve again
|
|
47
|
+
const resolvedId = await this.resolve(svelteRequest.filename);
|
|
48
|
+
if (resolvedId?.id) {
|
|
49
|
+
cachedCss = this.getModuleInfo(resolvedId.id)?.meta.svelte?.css;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
// in `build --watch` or dev ssr reloads getModuleInfo only returns changed module data.
|
|
48
54
|
// To ensure virtual css is loaded unchanged, we cache it here separately
|
|
49
55
|
if (useLocalCache) {
|
|
50
56
|
if (cachedCss) {
|
|
51
|
-
buildWatchCssCache.set(
|
|
57
|
+
buildWatchCssCache.set(svelteRequest.filename, cachedCss);
|
|
52
58
|
} else {
|
|
53
|
-
cachedCss = buildWatchCssCache.get(
|
|
59
|
+
cachedCss = buildWatchCssCache.get(svelteRequest.filename);
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
|