@unocss/vite 0.27.4 → 0.27.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -317,6 +317,9 @@ function GlobalModeDevPlugin({ uno, tokens, onInvalidate, extract, filter }) {
317
317
  servers.push(_server);
318
318
  setWarnTimer();
319
319
  _server.ws.on("connection", (ws) => {
320
+ ws.on("open", () => {
321
+ invalidate();
322
+ });
320
323
  ws.on("message", (msg) => {
321
324
  const message = String(msg);
322
325
  if (!message.startsWith(WS_EVENT_PREFIX))
@@ -327,9 +330,6 @@ function GlobalModeDevPlugin({ uno, tokens, onInvalidate, extract, filter }) {
327
330
  });
328
331
  });
329
332
  },
330
- buildStart() {
331
- setTimeout(() => invalidate(), 500);
332
- },
333
333
  transform(code, id) {
334
334
  if (filter(code, id))
335
335
  extract(code, id);
package/dist/index.mjs CHANGED
@@ -308,6 +308,9 @@ function GlobalModeDevPlugin({ uno, tokens, onInvalidate, extract, filter }) {
308
308
  servers.push(_server);
309
309
  setWarnTimer();
310
310
  _server.ws.on("connection", (ws) => {
311
+ ws.on("open", () => {
312
+ invalidate();
313
+ });
311
314
  ws.on("message", (msg) => {
312
315
  const message = String(msg);
313
316
  if (!message.startsWith(WS_EVENT_PREFIX))
@@ -318,9 +321,6 @@ function GlobalModeDevPlugin({ uno, tokens, onInvalidate, extract, filter }) {
318
321
  });
319
322
  });
320
323
  },
321
- buildStart() {
322
- setTimeout(() => invalidate(), 500);
323
- },
324
324
  transform(code, id) {
325
325
  if (filter(code, id))
326
326
  extract(code, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/vite",
3
- "version": "0.27.4",
3
+ "version": "0.27.5",
4
4
  "description": "The Vite plugin for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -35,11 +35,11 @@
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
37
  "@rollup/pluginutils": "^4.1.2",
38
- "@unocss/config": "0.27.4",
39
- "@unocss/core": "0.27.4",
40
- "@unocss/inspector": "0.27.4",
41
- "@unocss/scope": "0.27.4",
42
- "@unocss/transformer-directives": "0.27.4",
38
+ "@unocss/config": "0.27.5",
39
+ "@unocss/core": "0.27.5",
40
+ "@unocss/inspector": "0.27.5",
41
+ "@unocss/scope": "0.27.5",
42
+ "@unocss/transformer-directives": "0.27.5",
43
43
  "magic-string": "^0.26.1"
44
44
  },
45
45
  "devDependencies": {