File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @vanilla-extract/vite-plugin ' : patch
3+ ---
4+
5+ Fix bug where precompiled .css.ts files (.css.js) were treated differently in SSR mode.
Original file line number Diff line number Diff line change @@ -58,7 +58,12 @@ export function vanillaExtractPlugin({ identifiers }: Options = {}): Plugin {
5858 return null ;
5959 }
6060
61- if ( ssr && code . indexOf ( '@vanilla-extract/css/fileScope' ) === - 1 ) {
61+ if ( ssr ) {
62+ // If file already has a scope (has already run through babel plugin)
63+ if ( code . indexOf ( '@vanilla-extract/css/fileScope' ) > - 1 ) {
64+ return code ;
65+ }
66+
6267 const filePath = normalizePath ( path . relative ( packageInfo . dirname , id ) ) ;
6368
6469 const packageName = packageInfo . name
@@ -68,7 +73,6 @@ export function vanillaExtractPlugin({ identifiers }: Options = {}): Plugin {
6873 return `
6974 import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
7075 setFileScope("${ filePath } ", ${ packageName } );
71-
7276 ${ code }
7377 endFileScope();
7478 ` ;
You can’t perform that action at this time.
0 commit comments