We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7781d9f commit 4fb9a2cCopy full SHA for 4fb9a2c
.changeset/five-students-try.md
@@ -0,0 +1,5 @@
1
+---
2
+'@vanilla-extract/vite-plugin': patch
3
4
+
5
+Adds a check for the existence of import.meta.hot before attempting to add an event listener to inject styles
packages/vite-plugin/src/index.ts
@@ -114,9 +114,11 @@ export function vanillaExtractPlugin({
114
115
inject(${JSON.stringify(css)});
116
117
- import.meta.hot.on('${styleUpdateEvent(validId)}', (css) => {
118
- inject(css);
119
- });
+ if (import.meta.hot) {
+ import.meta.hot.on('${styleUpdateEvent(validId)}', (css) => {
+ inject(css);
120
+ });
121
+ }
122
`;
123
},
124
async transform(code, id, ssrParam) {
0 commit comments