File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @vanilla-extract/vite-plugin ' : patch
3+ ---
4+
5+ Fixes a bug where Vanilla Extract files with extensions other than ` css.ts ` were not being invalidated during HMR
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ export default `
1010 <div id="${ testNodes . styleCompositionInSelector } " class="${ styles . styleCompositionInSelector } ">Style composition in selector</div>
1111 <div id="${ testNodes . styleVariantsCompositionInSelector } " class="${ styles . styleVariantsCompositionInSelector . variant } ">Style variants composition in selector</div>
1212 ` ;
13+
14+ // @ts -expect-error Vite env not defined
15+ if ( import . meta. hot ) {
16+ // @ts -expect-error Vite env not defined
17+ import . meta. hot . accept ( ) ;
18+ }
Original file line number Diff line number Diff line change @@ -5,10 +5,3 @@ function render() {
55}
66
77render ( ) ;
8-
9- // Uncomment to enable HMR with Vite
10- // if (import.meta.hot) {
11- // import.meta.hot.accept('./features.css', () => {
12- // render();
13- // });
14- // }
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ export function vanillaExtractPlugin({
214214 // We have to invalidate the virtual module & deps, not the real one we just transformed
215215 // The deps have to be invalidated in case one of them changing was the trigger causing
216216 // the current transformation
217- if ( file . endsWith ( '.css.ts' ) ) {
217+ if ( cssFileFilter . test ( file ) ) {
218218 invalidateModule ( fileIdToVirtualId ( file ) ) ;
219219 }
220220 }
You can’t perform that action at this time.
0 commit comments