mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 03:54:46 +00:00
various
This commit is contained in:
@@ -47,7 +47,8 @@ export default class RollupResult implements CompileResult {
|
||||
} else {
|
||||
for (const name in compiler.input) {
|
||||
const file = compiler.input[name];
|
||||
this.assets[name] = compiler.chunks.find(chunk => file in chunk.modules).fileName;
|
||||
const chunk = compiler.chunks.find(chunk => file in chunk.modules);
|
||||
if (chunk) this.assets[name] = chunk.fileName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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