Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Fix style output with emitCss: false #1532

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/create_compilers/RollupCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,16 @@ export default class RollupCompiler {

// We consider the dependencies of the entry chunk as well when finding the CSS in
// case preserveEntrySignatures is true and there are multiple chunks
that.css_main = find_css(entry_chunk, bundle);
const entry_css = find_css(entry_chunk, bundle);
that.css_main = entry_css && entry_css.length ? entry_css : undefined;

// Routes dependencies
function add_dependencies(chunk: RenderedChunk) {
for (const module of Object.keys(chunk.modules)) {
if (is_route(module)) {
const js_dependencies = js_deps(chunk,
{ walk: ctx => !ctx.dynamicImport && ctx.chunk.fileName !== entry_chunk.fileName }).map(c => c.fileName);
const css_dependencies = find_css(chunk, bundle).filter(x => !that.css_main.includes(x));
const css_dependencies = find_css(chunk, bundle).filter(x => !that.css_main || !that.css_main.includes(x));
dependencies[module] = js_dependencies.concat(css_dependencies);
}
}
Expand Down