@varlet/vite-plugins 3.19.2 → 3.20.0

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.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Plugin } from "vite";
2
-
3
2
  //#region src/markdown.d.ts
4
3
  interface MarkdownOptions {
5
4
  style?: string;
package/lib/index.js CHANGED
@@ -134,9 +134,10 @@ function inlineCss(options) {
134
134
  }
135
135
  const cssCode = readFileSync(cssFile, "utf-8");
136
136
  const jsCode = readFileSync(jsFile, "utf-8");
137
- writeFileSync(jsFile, `${`;(function(){var style=document.createElement('style');style.type='text/css';\
137
+ const injectCode = `;(function(){var style=document.createElement('style');style.type='text/css';\
138
138
  style.rel='stylesheet';style.appendChild(document.createTextNode(\`${cssCode.replace(/\\/g, "\\\\")}\`));\
139
- var head=document.querySelector('head');head.appendChild(style)})();`}${jsCode}`);
139
+ var head=document.querySelector('head');head.appendChild(style)})();`;
140
+ writeFileSync(jsFile, `${injectCode}${jsCode}`);
140
141
  removeSync(cssFile);
141
142
  onEnd?.();
142
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/vite-plugins",
3
- "version": "3.19.2",
3
+ "version": "3.20.0",
4
4
  "description": "vite plugins of varlet",
5
5
  "keywords": [
6
6
  "vite",
@@ -29,7 +29,7 @@
29
29
  "highlight.js": "^10.7.2",
30
30
  "markdown-it": "^12.2.3",
31
31
  "pinyin-pro": "3.17.0",
32
- "@varlet/shared": "3.19.2"
32
+ "@varlet/shared": "3.20.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/ejs": "^3.1.1",
@@ -37,10 +37,10 @@
37
37
  "@types/markdown-it": "^12.2.3",
38
38
  "@types/node": "^20.19.0",
39
39
  "typescript": "5.6.3",
40
- "vite-plus": "0.1.18"
40
+ "vite-plus": "0.2.6"
41
41
  },
42
42
  "peerDependencies": {
43
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.18"
43
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.2.6"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "vp pack",