@wsxjs/wsx-vite-plugin 0.0.7 → 0.0.9

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.mts CHANGED
@@ -1,39 +1,19 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
3
  /**
4
- * Vite Plugin for WSX (Web Component JSX)
4
+ * Vite Plugin for WSX with Babel decorator support
5
5
  *
6
- * 专门处理.wsx文件:
7
- * - 自动添加JSX pragma
8
- * - 支持TypeScript编译
9
- * - 完全隔离,不影响主项目React配置
6
+ * Uses Babel to preprocess decorators before esbuild transformation
7
+ * This ensures decorators work correctly even with esbuild's limitations
10
8
  */
11
9
 
12
10
  interface WSXPluginOptions {
13
- /**
14
- * JSX工厂函数名
15
- * @default 'h'
16
- */
17
11
  jsxFactory?: string;
18
- /**
19
- * JSX Fragment函数名
20
- * @default 'Fragment'
21
- */
22
12
  jsxFragment?: string;
23
- /**
24
- * 是否启用调试日志
25
- * @default false
26
- */
27
13
  debug?: boolean;
28
- /**
29
- * 文件扩展名
30
- * @default ['.wsx']
31
- */
32
14
  extensions?: string[];
15
+ autoStyleInjection?: boolean;
33
16
  }
34
- /**
35
- * WSX Vite插件
36
- */
37
- declare function vitePluginWSX(options?: WSXPluginOptions): Plugin;
17
+ declare function vitePluginWSXWithBabel(options?: WSXPluginOptions): Plugin;
38
18
 
39
- export { vitePluginWSX as wsx };
19
+ export { vitePluginWSXWithBabel as wsx };
package/dist/index.d.ts CHANGED
@@ -1,39 +1,19 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
3
  /**
4
- * Vite Plugin for WSX (Web Component JSX)
4
+ * Vite Plugin for WSX with Babel decorator support
5
5
  *
6
- * 专门处理.wsx文件:
7
- * - 自动添加JSX pragma
8
- * - 支持TypeScript编译
9
- * - 完全隔离,不影响主项目React配置
6
+ * Uses Babel to preprocess decorators before esbuild transformation
7
+ * This ensures decorators work correctly even with esbuild's limitations
10
8
  */
11
9
 
12
10
  interface WSXPluginOptions {
13
- /**
14
- * JSX工厂函数名
15
- * @default 'h'
16
- */
17
11
  jsxFactory?: string;
18
- /**
19
- * JSX Fragment函数名
20
- * @default 'Fragment'
21
- */
22
12
  jsxFragment?: string;
23
- /**
24
- * 是否启用调试日志
25
- * @default false
26
- */
27
13
  debug?: boolean;
28
- /**
29
- * 文件扩展名
30
- * @default ['.wsx']
31
- */
32
14
  extensions?: string[];
15
+ autoStyleInjection?: boolean;
33
16
  }
34
- /**
35
- * WSX Vite插件
36
- */
37
- declare function vitePluginWSX(options?: WSXPluginOptions): Plugin;
17
+ declare function vitePluginWSXWithBabel(options?: WSXPluginOptions): Plugin;
38
18
 
39
- export { vitePluginWSX as wsx };
19
+ export { vitePluginWSXWithBabel as wsx };