@varlet/vite-plugins 3.5.0 → 3.5.1-alpha.1726764162524

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/lib/index.js CHANGED
@@ -100,6 +100,13 @@ function markdown(options) {
100
100
  } catch (e) {
101
101
  this.error(e);
102
102
  }
103
+ },
104
+ handleHotUpdate(ctx) {
105
+ if (!/\.md$/.test(ctx.file)) {
106
+ return;
107
+ }
108
+ const { read } = ctx;
109
+ ctx.read = async () => markdownToVue(await read(), options);
103
110
  }
104
111
  };
105
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/vite-plugins",
3
- "version": "3.5.0",
3
+ "version": "3.5.1-alpha.1726764162524",
4
4
  "type": "module",
5
5
  "description": "vite plugins of varlet",
6
6
  "main": "lib/index.js",
@@ -26,7 +26,7 @@
26
26
  "highlight.js": "^10.7.2",
27
27
  "markdown-it": "^12.2.3",
28
28
  "pinyin-pro": "3.17.0",
29
- "@varlet/shared": "3.5.0"
29
+ "@varlet/shared": "3.5.1-alpha.1726764162524"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ejs": "^3.1.1",
@@ -35,7 +35,7 @@
35
35
  "@types/node": "^18.7.20",
36
36
  "tsup": "7.2.0",
37
37
  "typescript": "^5.1.5",
38
- "vite": "5.0.10"
38
+ "vite": "5.4.6"
39
39
  },
40
40
  "scripts": {
41
41
  "dev": "tsup src/index.ts --format esm --out-dir=lib --watch --dts",
package/src/markdown.ts CHANGED
@@ -142,5 +142,14 @@ export function markdown(options: MarkdownOptions): Plugin {
142
142
  this.error(e)
143
143
  }
144
144
  },
145
+
146
+ handleHotUpdate(ctx) {
147
+ if (!/\.md$/.test(ctx.file)) {
148
+ return
149
+ }
150
+
151
+ const {read} = ctx
152
+ ctx.read = async () => markdownToVue(await read(), options)
153
+ },
145
154
  }
146
155
  }