Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linker): order of css imported from js #1342

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions internal/bundler/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2809,8 +2809,8 @@ func (c *linkerContext) findImportedFilesInCSSOrder(entryPoints []uint32) (exter
}

// Include all files reachable from any entry point
for _, entryPoint := range entryPoints {
visit(entryPoint, ast.Index32{})
for i := len(entryPoints) - 1; i >= 0; i = i - 1 {
visit(entryPoints[i], ast.Index32{})
}

// Reverse the order afterward when traversing in CSS order
Expand Down
10 changes: 5 additions & 5 deletions internal/bundler/snapshots/snapshots_css.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ console.log("a");
console.log("b");

---------- /out/entry.css ----------
/* b.css */
.b {
color: blue;
}

/* a.css */
.a {
color: red;
}

/* b.css */
.b {
color: blue;
}

================================================================================
TestPackageURLsInCSS
---------- /out/entry.css ----------
Expand Down