wip: try removing ssrLoadModule on styles
This commit is contained in:
parent
bb71be78db
commit
880e73d94a
1 changed files with 0 additions and 12 deletions
|
@ -3,12 +3,6 @@ import vite from 'vite';
|
||||||
import { unwrapId } from '../../util.js';
|
import { unwrapId } from '../../util.js';
|
||||||
import { STYLE_EXTENSIONS } from '../util.js';
|
import { STYLE_EXTENSIONS } from '../util.js';
|
||||||
|
|
||||||
/**
|
|
||||||
* List of file extensions signalling we can (and should) SSR ahead-of-time
|
|
||||||
* See usage below
|
|
||||||
*/
|
|
||||||
const fileExtensionsToSSR = new Set(['.astro', '.md']);
|
|
||||||
|
|
||||||
const STRIP_QUERY_PARAMS_REGEX = /\?.*$/;
|
const STRIP_QUERY_PARAMS_REGEX = /\?.*$/;
|
||||||
|
|
||||||
/** recursively crawl the module graph to get all style files imported by parent id */
|
/** recursively crawl the module graph to get all style files imported by parent id */
|
||||||
|
@ -56,12 +50,6 @@ export async function* crawlGraph(
|
||||||
if (entryIsStyle && !STYLE_EXTENSIONS.has(npath.extname(importedModulePathname))) {
|
if (entryIsStyle && !STYLE_EXTENSIONS.has(npath.extname(importedModulePathname))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fileExtensionsToSSR.has(npath.extname(importedModulePathname))) {
|
|
||||||
const mod = viteServer.moduleGraph.getModuleById(importedModule.id);
|
|
||||||
if (!mod?.ssrModule) {
|
|
||||||
await viteServer.ssrLoadModule(importedModule.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
importedModules.add(importedModule);
|
importedModules.add(importedModule);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue