@varlet/vite-plugins 2.7.0-alpha.1673617166404 → 2.7.0-alpha.1673622160795

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/inlineCss.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import fse from 'fs-extra';
2
- const { pathExistsSync, writeFileSync, readFileSync } = fse;
2
+ const { pathExistsSync, writeFileSync, readFileSync, removeSync } = fse;
3
3
  export function inlineCss(options) {
4
4
  return {
5
5
  name: 'vite-plugin-varlet-inline-css',
@@ -22,6 +22,7 @@ export function inlineCss(options) {
22
22
  style.rel='stylesheet';style.appendChild(document.createTextNode(\`${cssCode.replace(/\\/g, '\\\\')}\`));\
23
23
  var head=document.querySelector('head');head.appendChild(style)})();`;
24
24
  writeFileSync(jsFile, `${injectCode}${jsCode}`);
25
+ removeSync(cssFile);
25
26
  onEnd === null || onEnd === void 0 ? void 0 : onEnd();
26
27
  },
27
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/vite-plugins",
3
- "version": "2.7.0-alpha.1673617166404",
3
+ "version": "2.7.0-alpha.1673622160795",
4
4
  "type": "module",
5
5
  "description": "vite plugins of varlet",
6
6
  "main": "lib/index.js",
@@ -25,7 +25,7 @@
25
25
  "fs-extra": "^9.0.1",
26
26
  "highlight.js": "^10.7.2",
27
27
  "markdown-it": "^12.2.3",
28
- "@varlet/shared": "2.7.0-alpha.1673617166404"
28
+ "@varlet/shared": "2.7.0-alpha.1673622160795"
29
29
  },
30
30
  "devDependencies": {
31
31
  "vite": "^4.0.4",
package/src/inlineCss.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Plugin } from 'vite'
2
2
  import fse from 'fs-extra'
3
3
 
4
- const { pathExistsSync, writeFileSync, readFileSync } = fse
4
+ const { pathExistsSync, writeFileSync, readFileSync, removeSync } = fse
5
5
 
6
6
  export interface InlineCssOptions {
7
7
  cssFile: string
@@ -37,6 +37,7 @@ style.rel='stylesheet';style.appendChild(document.createTextNode(\`${cssCode.rep
37
37
  var head=document.querySelector('head');head.appendChild(style)})();`
38
38
 
39
39
  writeFileSync(jsFile, `${injectCode}${jsCode}`)
40
+ removeSync(cssFile)
40
41
  onEnd?.()
41
42
  },
42
43
  }