@vitarx/plugin-vite 1.0.0-beta.8 → 1.0.1

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.d.ts CHANGED
@@ -27,6 +27,7 @@ export interface VitePluginVitarxOptions {
27
27
  * - 支持 className 转 class(仅原生 HTML 元素)
28
28
  *
29
29
  * @param options - 插件配置选项。
30
+ * @param [options.transformClassNameToClass=false] - 支持className。
30
31
  * @returns - vite插件对象。
31
32
  */
32
33
  export default function vitarx(options?: VitePluginVitarxOptions): Plugin;
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ const IS_V8 = version.startsWith('8');
15
15
  * - 支持 className 转 class(仅原生 HTML 元素)
16
16
  *
17
17
  * @param options - 插件配置选项。
18
+ * @param [options.transformClassNameToClass=false] - 支持className。
18
19
  * @returns - vite插件对象。
19
20
  */
20
21
  export default function vitarx(options) {
@@ -25,10 +26,9 @@ export default function vitarx(options) {
25
26
  let viteTransform;
26
27
  return {
27
28
  name: 'vite-plugin-vitarx',
28
- enforce: 'pre',
29
29
  config(config, env) {
30
30
  isDEV = env.command === 'serve' && !env.isPreview;
31
- isSSR = env.isSsrBuild === true;
31
+ isSSR = env.isSsrBuild === true || !!config.build?.ssr;
32
32
  return {
33
33
  define: {
34
34
  __VITARX_DEV__: JSON.stringify(isDEV),
@@ -45,10 +45,6 @@ export default function vitarx(options) {
45
45
  };
46
46
  },
47
47
  async configResolved(config) {
48
- if (!isSSR) {
49
- isSSR = !!config.build?.ssr;
50
- config.define['__VITARX_SSR__'] = JSON.stringify(isSSR);
51
- }
52
48
  compileOptions = {
53
49
  dev: isDEV,
54
50
  ssr: isSSR,
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RenderUnit, View } from 'vitarx';
1
+ import type { Renderable, View } from 'vitarx';
2
2
  /**
3
3
  * 编译选项
4
4
  */
@@ -24,7 +24,7 @@ export interface SwitchProps {
24
24
  *
25
25
  * 当所有 `Match` 都不匹配时,渲染该内容
26
26
  */
27
- fallback?: RenderUnit;
27
+ fallback?: Renderable;
28
28
  /**
29
29
  * 子元素列表
30
30
  *
@@ -40,7 +40,7 @@ export interface MatchProps {
40
40
  /**
41
41
  * 匹配成功时渲染的内容
42
42
  */
43
- children: RenderUnit;
43
+ children: Renderable;
44
44
  }
45
45
  declare global {
46
46
  namespace Vitarx {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitarx/plugin-vite",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.1",
4
4
  "description": "The official plugin for Vitarx support in Vite.",
5
5
  "author": "ZhuChongLin <8210856@qq.com>",
6
6
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  }
36
36
  },
37
37
  "peerDependencies": {
38
- "vitarx": "^4.0.0-0",
39
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0"
38
+ "vitarx": "^4.0.0",
39
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@babel/generator": "^7.29.1",
@@ -47,6 +47,7 @@
47
47
  "acorn-walk": "^8.3.5"
48
48
  },
49
49
  "devDependencies": {
50
+ "typescript": "^6.0.3",
50
51
  "@commitlint/cli": "^20.4.2",
51
52
  "@commitlint/config-conventional": "^20.4.2",
52
53
  "@commitlint/types": "^20.4.0",
@@ -60,12 +61,12 @@
60
61
  "rimraf": "^6.1.3",
61
62
  "vitest": "^4.0.18",
62
63
  "vite": "^8.0.5",
63
- "vitarx": "^4.0.0-beta.16"
64
+ "vitarx": "^4.0.0"
64
65
  },
65
66
  "scripts": {
66
67
  "build": "vitest run && rimraf dist && tsc -p tsconfig.build.json",
67
68
  "test": "vitest run",
68
69
  "typecheck": "tsc --noEmit",
69
- "release": "release-cli"
70
+ "release": "npx change-push"
70
71
  }
71
72
  }