Skip to content

Commit

Permalink
RSC: css preinit: Add required option precedence (#10481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Apr 20, 2024
1 parent a8378ae commit 52f2a25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ describe('rscCssPreinitPlugin', () => {
name = "Anonymous"
}) => {
preinit("assets/Counter-BZpJq_HD.css", {
as: "style"
as: "style",
precedence: "medium"
});
preinit("assets/rsc-DeepSubCounter-DqMovEyK.css", {
as: "style"
as: "style",
precedence: "medium"
});
preinit("assets/rsc-SubCounter-Bc4odF6o.css", {
as: "style"
as: "style",
precedence: "medium"
});
return /* @__PURE__ */jsxs("div", {
className: "home-page",
Expand Down
4 changes: 4 additions & 0 deletions packages/vite/src/plugins/vite-plugin-rsc-css-preinit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export function rscCssPreinitPlugin(
t.identifier('as'),
t.stringLiteral('style'),
),
t.objectProperty(
t.identifier('precedence'),
t.stringLiteral('medium'),
),
]),
]),
),
Expand Down

0 comments on commit 52f2a25

Please sign in to comment.