Skip to content

Commit

Permalink
fix(linker): order of css imported from js (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrage authored Jun 4, 2021
1 parent 92d5449 commit c765bc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit c765bc1

Please sign in to comment.