wip: try removing ssrLoadModule on styles

This commit is contained in:
bholmesdev 2022-08-29 18:25:14 -04:00
parent bb71be78db
commit 880e73d94a

View file

@ -3,12 +3,6 @@ import vite from 'vite';
import { unwrapId } 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 = /\?.*$/;
/** 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))) {
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);
}