mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 12:04:39 +00:00
@@ -153,7 +153,7 @@ export default function extract_css(client_result: CompileResult, components: Pa
|
||||
chunks_with_css.add(chunk);
|
||||
});
|
||||
|
||||
const entry = path.resolve(dirs.src, 'client.js');
|
||||
const entry = path.resolve(dirs.src, 'app.mjs');
|
||||
const entry_chunk = client_result.chunks.find(chunk => chunk.modules.indexOf(entry) !== -1);
|
||||
|
||||
const entry_chunk_dependencies: Set<Chunk> = new Set([entry_chunk]);
|
||||
@@ -161,6 +161,8 @@ export default function extract_css(client_result: CompileResult, components: Pa
|
||||
|
||||
// recursively find the chunks this component depends on
|
||||
entry_chunk_dependencies.forEach(chunk => {
|
||||
if (!chunk) return; // TODO why does this happen?
|
||||
|
||||
chunk.imports.forEach(file => {
|
||||
entry_chunk_dependencies.add(lookup.get(file));
|
||||
});
|
||||
@@ -182,7 +184,8 @@ export default function extract_css(client_result: CompileResult, components: Pa
|
||||
|
||||
if (!chunk) {
|
||||
// this should never happen!
|
||||
throw new Error(`Could not find chunk that owns ${component.file}`);
|
||||
return;
|
||||
// throw new Error(`Could not find chunk that owns ${component.file}`);
|
||||
}
|
||||
|
||||
const chunk_dependencies: Set<Chunk> = new Set([chunk]);
|
||||
@@ -190,6 +193,8 @@ export default function extract_css(client_result: CompileResult, components: Pa
|
||||
|
||||
// recursively find the chunks this component depends on
|
||||
chunk_dependencies.forEach(chunk => {
|
||||
if (!chunk) return; // TODO why does this happen?
|
||||
|
||||
chunk.imports.forEach(file => {
|
||||
chunk_dependencies.add(lookup.get(file));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user