vue-jsx-vapor 2.6.8 → 2.7.4

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.
Files changed (70) hide show
  1. package/dist/api.cjs +1 -1
  2. package/dist/api.d.cts +4 -4
  3. package/dist/api.d.ts +4 -4
  4. package/dist/api.js +1 -1
  5. package/dist/astro.cjs +3 -3
  6. package/dist/astro.d.cts +2 -3
  7. package/dist/astro.d.ts +1 -1
  8. package/dist/astro.js +3 -3
  9. package/dist/core-BeuKLsFR.cjs +22 -0
  10. package/dist/core-CfhBppKN.js +15 -0
  11. package/dist/esbuild.cjs +3 -3
  12. package/dist/esbuild.d.cts +4 -5
  13. package/dist/esbuild.d.ts +3 -3
  14. package/dist/esbuild.js +3 -3
  15. package/dist/index.js +2 -0
  16. package/dist/nuxt.cjs +7 -6
  17. package/dist/nuxt.d.cts +1 -1
  18. package/dist/nuxt.d.ts +3 -3
  19. package/dist/nuxt.js +5 -5
  20. package/dist/{options-CBMw6D8V.d.ts → options-D6zn5V49.d.ts} +1 -1
  21. package/dist/{options-jKAq0dFf.d.cts → options-DxHQU8-_.d.cts} +1 -1
  22. package/dist/raw-B3KlYN7X.js +119 -0
  23. package/dist/raw-DG3OYbEe.cjs +132 -0
  24. package/dist/raw.cjs +2 -2
  25. package/dist/raw.d.cts +2 -3
  26. package/dist/raw.d.ts +1 -1
  27. package/dist/raw.js +2 -2
  28. package/dist/rolldown.cjs +5 -4
  29. package/dist/rolldown.d.cts +4 -5
  30. package/dist/rolldown.d.ts +3 -3
  31. package/dist/rolldown.js +3 -3
  32. package/dist/rollup.cjs +3 -3
  33. package/dist/rollup.d.cts +4 -5
  34. package/dist/rollup.d.ts +3 -3
  35. package/dist/rollup.js +3 -3
  36. package/dist/rspack.cjs +3 -3
  37. package/dist/rspack.d.cts +2 -3
  38. package/dist/rspack.d.ts +1 -1
  39. package/dist/rspack.js +3 -3
  40. package/dist/{unplugin-aKVZLoq9.cjs → unplugin-6bs2zQro.cjs} +3 -2
  41. package/dist/{unplugin-CyifZGPt.js → unplugin-BPAlTDcQ.js} +2 -2
  42. package/dist/unplugin.cjs +3 -3
  43. package/dist/unplugin.d.cts +4 -4
  44. package/dist/unplugin.d.ts +4 -4
  45. package/dist/unplugin.js +3 -3
  46. package/dist/{vite-C63GJQHT.cjs → vite-D8MCYNCu.cjs} +1 -1
  47. package/dist/vite-EGcRF3B5.js +7 -0
  48. package/dist/vite.cjs +4 -4
  49. package/dist/vite.d.cts +4 -5
  50. package/dist/vite.d.ts +3 -3
  51. package/dist/vite.js +4 -4
  52. package/dist/volar.cjs +10 -5
  53. package/dist/volar.d.cts +1 -1
  54. package/dist/volar.d.ts +1 -1
  55. package/dist/{webpack-CeAur76z.cjs → webpack-CAtjl4UN.cjs} +1 -1
  56. package/dist/webpack-DdK9_Sb1.js +7 -0
  57. package/dist/webpack.cjs +4 -4
  58. package/dist/webpack.d.cts +4 -5
  59. package/dist/webpack.d.ts +3 -3
  60. package/dist/webpack.js +4 -4
  61. package/package.json +4 -5
  62. package/dist/core-C-41-Q2Y.cjs +0 -33
  63. package/dist/core-CJgJmh2O.js +0 -27
  64. package/dist/options.d.cjs +0 -0
  65. package/dist/options.d.cts +0 -2
  66. package/dist/options.d.ts +0 -2
  67. package/dist/raw-B2YMrqwY.cjs +0 -213
  68. package/dist/raw-CWZ5g7Vk.js +0 -207
  69. package/dist/vite-Djd6MAt9.js +0 -7
  70. package/dist/webpack-3fgVTA33.js +0 -7
package/dist/api.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_core = require('./core-C-41-Q2Y.cjs');
1
+ const require_core = require('./core-BeuKLsFR.cjs');
2
2
 
3
3
  exports.transformVueJsxVapor = require_core.transformVueJsxVapor;
package/dist/api.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
2
- import * as _babel_core14 from "@babel/core";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
+ import * as _vue_jsx_vapor_compiler_rs0 from "@vue-jsx-vapor/compiler-rs";
3
3
 
4
4
  //#region src/core/index.d.ts
5
- declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): _babel_core14.BabelFileResult | null;
5
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean, needHMR?: boolean, ssr?: boolean): _vue_jsx_vapor_compiler_rs0.TransformReturn;
6
6
  //#endregion
7
- export { Options, transformVueJsxVapor };
7
+ export { type Options, transformVueJsxVapor };
package/dist/api.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Options } from "./options-CBMw6D8V.js";
2
- import * as _babel_core14 from "@babel/core";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
+ import * as _vue_jsx_vapor_compiler_rs0 from "@vue-jsx-vapor/compiler-rs";
3
3
 
4
4
  //#region src/core/index.d.ts
5
- declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): _babel_core14.BabelFileResult | null;
5
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean, needHMR?: boolean, ssr?: boolean): _vue_jsx_vapor_compiler_rs0.TransformReturn;
6
6
  //#endregion
7
- export { Options, transformVueJsxVapor };
7
+ export { type Options, transformVueJsxVapor };
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { transformVueJsxVapor } from "./core-CJgJmh2O.js";
1
+ import { t as transformVueJsxVapor } from "./core-CfhBppKN.js";
2
2
 
3
3
  export { transformVueJsxVapor };
package/dist/astro.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-C-41-Q2Y.cjs');
3
- require('./raw-B2YMrqwY.cjs');
4
- const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
2
+ require('./core-BeuKLsFR.cjs');
3
+ require('./raw-DG3OYbEe.cjs');
4
+ const require_unplugin = require('./unplugin-6bs2zQro.cjs');
5
5
 
6
6
  //#region src/astro.ts
7
7
  var astro_default = (options) => ({
package/dist/astro.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
2
 
3
3
  //#region src/astro.d.ts
4
4
  declare const _default: (options: Options) => {
@@ -7,5 +7,4 @@ declare const _default: (options: Options) => {
7
7
  'astro:config:setup': (astro: any) => void;
8
8
  };
9
9
  };
10
- //#endregion
11
- export { _default as default };
10
+ export = _default;
package/dist/astro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./options-CBMw6D8V.js";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
2
 
3
3
  //#region src/astro.d.ts
4
4
  declare const _default: (options: Options) => {
package/dist/astro.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./core-CJgJmh2O.js";
2
- import "./raw-CWZ5g7Vk.js";
3
- import { unplugin_default } from "./unplugin-CyifZGPt.js";
1
+ import "./core-CfhBppKN.js";
2
+ import "./raw-B3KlYN7X.js";
3
+ import { r as unplugin_default } from "./unplugin-BPAlTDcQ.js";
4
4
 
5
5
  //#region src/astro.ts
6
6
  var astro_default = (options) => ({
@@ -0,0 +1,22 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ let __vue_jsx_vapor_compiler_rs = require("@vue-jsx-vapor/compiler-rs");
3
+ __vue_jsx_vapor_compiler_rs = require_chunk.__toESM(__vue_jsx_vapor_compiler_rs);
4
+
5
+ //#region src/core/index.ts
6
+ function transformVueJsxVapor(code, id, options, needSourceMap = false, needHMR = false, ssr = false) {
7
+ return (0, __vue_jsx_vapor_compiler_rs.transform)(code, {
8
+ filename: id,
9
+ sourceMap: needSourceMap,
10
+ interop: new URLSearchParams(id).get("vapor") ? false : options?.interop,
11
+ hmr: needHMR,
12
+ ssr
13
+ });
14
+ }
15
+
16
+ //#endregion
17
+ Object.defineProperty(exports, 'transformVueJsxVapor', {
18
+ enumerable: true,
19
+ get: function () {
20
+ return transformVueJsxVapor;
21
+ }
22
+ });
@@ -0,0 +1,15 @@
1
+ import { transform } from "@vue-jsx-vapor/compiler-rs";
2
+
3
+ //#region src/core/index.ts
4
+ function transformVueJsxVapor(code, id, options, needSourceMap = false, needHMR = false, ssr = false) {
5
+ return transform(code, {
6
+ filename: id,
7
+ sourceMap: needSourceMap,
8
+ interop: new URLSearchParams(id).get("vapor") ? false : options?.interop,
9
+ hmr: needHMR,
10
+ ssr
11
+ });
12
+ }
13
+
14
+ //#endregion
15
+ export { transformVueJsxVapor as t };
package/dist/esbuild.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-C-41-Q2Y.cjs');
3
- require('./raw-B2YMrqwY.cjs');
4
- const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
2
+ require('./core-BeuKLsFR.cjs');
3
+ require('./raw-DG3OYbEe.cjs');
4
+ const require_unplugin = require('./unplugin-6bs2zQro.cjs');
5
5
 
6
6
  //#region src/esbuild.ts
7
7
  var esbuild_default = require_unplugin.unplugin_default.esbuild;
@@ -1,7 +1,6 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
2
- import * as esbuild2 from "esbuild";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
+ import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild2.Plugin;
6
- //#endregion
7
- export { _default as default };
5
+ declare const _default: (options?: Options | undefined) => esbuild0.Plugin;
6
+ export = _default;
package/dist/esbuild.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Options } from "./options-CBMw6D8V.js";
2
- import * as esbuild7 from "esbuild";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
+ import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild7.Plugin;
5
+ declare const _default: (options?: Options | undefined) => esbuild0.Plugin;
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./core-CJgJmh2O.js";
2
- import "./raw-CWZ5g7Vk.js";
3
- import { unplugin_default } from "./unplugin-CyifZGPt.js";
1
+ import "./core-CfhBppKN.js";
2
+ import "./raw-B3KlYN7X.js";
3
+ import { r as unplugin_default } from "./unplugin-BPAlTDcQ.js";
4
4
 
5
5
  //#region src/esbuild.ts
6
6
  var esbuild_default = unplugin_default.esbuild;
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
1
  export * from "@vue-jsx-vapor/runtime"
2
+
3
+ export { };
package/dist/nuxt.cjs CHANGED
@@ -1,11 +1,12 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CUT6urMc.cjs');
3
- require('./core-C-41-Q2Y.cjs');
4
- require('./raw-B2YMrqwY.cjs');
5
- require('./unplugin-aKVZLoq9.cjs');
6
- const require_vite = require('./vite-C63GJQHT.cjs');
7
- const require_webpack = require('./webpack-CeAur76z.cjs');
8
- const __nuxt_kit = require_chunk.__toESM(require("@nuxt/kit"));
3
+ require('./core-BeuKLsFR.cjs');
4
+ require('./raw-DG3OYbEe.cjs');
5
+ require('./unplugin-6bs2zQro.cjs');
6
+ const require_vite = require('./vite-D8MCYNCu.cjs');
7
+ const require_webpack = require('./webpack-CAtjl4UN.cjs');
8
+ let __nuxt_kit = require("@nuxt/kit");
9
+ __nuxt_kit = require_chunk.__toESM(__nuxt_kit);
9
10
  require("@nuxt/schema");
10
11
 
11
12
  //#region src/nuxt.ts
package/dist/nuxt.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
2
  import * as _nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
package/dist/nuxt.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Options } from "./options-CBMw6D8V.js";
2
- import * as _nuxt_schema5 from "@nuxt/schema";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
+ import * as _nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
5
5
  interface ModuleOptions extends Options {}
6
- declare const _default: _nuxt_schema5.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+ declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
7
  //#endregion
8
8
  export { ModuleOptions, _default as default };
package/dist/nuxt.js CHANGED
@@ -1,8 +1,8 @@
1
- import "./core-CJgJmh2O.js";
2
- import "./raw-CWZ5g7Vk.js";
3
- import "./unplugin-CyifZGPt.js";
4
- import { vite_default } from "./vite-Djd6MAt9.js";
5
- import { webpack_default } from "./webpack-3fgVTA33.js";
1
+ import "./core-CfhBppKN.js";
2
+ import "./raw-B3KlYN7X.js";
3
+ import "./unplugin-BPAlTDcQ.js";
4
+ import { t as vite_default } from "./vite-EGcRF3B5.js";
5
+ import { t as webpack_default } from "./webpack-DdK9_Sb1.js";
6
6
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
7
7
  import "@nuxt/schema";
8
8
 
@@ -18,4 +18,4 @@ interface Options$1 {
18
18
  macros?: Options | boolean;
19
19
  }
20
20
  //#endregion
21
- export { Options$1 as Options };
21
+ export { Options$1 as t };
@@ -18,4 +18,4 @@ interface Options$1 {
18
18
  macros?: Options | boolean;
19
19
  }
20
20
  //#endregion
21
- export { Options$1 as Options };
21
+ export { Options$1 as t };
@@ -0,0 +1,119 @@
1
+ import { t as transformVueJsxVapor } from "./core-CfhBppKN.js";
2
+ import macros from "@vue-jsx-vapor/macros/raw";
3
+ import { transformJsxDirective } from "@vue-macros/jsx-directive/api";
4
+ import { relative } from "pathe";
5
+ import { createFilter, normalizePath } from "unplugin-utils";
6
+ import { transformSync } from "@babel/core";
7
+ import babelTypescript from "@babel/plugin-transform-typescript";
8
+ import jsx from "@vue/babel-plugin-jsx";
9
+
10
+ //#region src/core/ssr.ts
11
+ const ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
12
+ const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\nexport const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
13
+ /**
14
+ * This function is serialized with toString() and evaluated as a virtual
15
+ * module during SSR
16
+ */
17
+ function ssrRegisterHelper(comp, filename) {
18
+ if (typeof comp === "function") comp.__setup = () => {
19
+ const ssrContext = useSSRContext();
20
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
21
+ };
22
+ else {
23
+ const setup = comp.setup;
24
+ comp.setup = (props, ctx) => {
25
+ const ssrContext = useSSRContext();
26
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
27
+ if (setup) return setup(props, ctx);
28
+ };
29
+ }
30
+ }
31
+
32
+ //#endregion
33
+ //#region src/core/vue-jsx.ts
34
+ function transformVueJsx(code, id, needSourceMap = false) {
35
+ const result = transformSync(code, {
36
+ plugins: [jsx, ...id.endsWith(".tsx") ? [[babelTypescript, {
37
+ isTSX: true,
38
+ allowExtensions: true
39
+ }]] : []],
40
+ filename: id,
41
+ sourceMaps: needSourceMap,
42
+ sourceFileName: id,
43
+ babelrc: false,
44
+ configFile: false
45
+ });
46
+ if (result?.code && result.code !== code) return {
47
+ code: result.code,
48
+ map: result.map
49
+ };
50
+ }
51
+
52
+ //#endregion
53
+ //#region src/raw.ts
54
+ const plugin = (options = {}) => {
55
+ const transformInclude = createFilter(options?.include || /\.[cm]?[jt]sx$/, options?.exclude || /node_modules/);
56
+ let root = "";
57
+ let needHMR = false;
58
+ let needSourceMap = false;
59
+ return [
60
+ ...options.macros === false ? [] : options.macros ? [macros(options.macros === true ? void 0 : options.macros)] : [],
61
+ {
62
+ enforce: "pre",
63
+ name: "vue-jsx-vapor",
64
+ vite: {
65
+ config(config) {
66
+ return { define: {
67
+ __VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
68
+ __VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
69
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
70
+ } };
71
+ },
72
+ configResolved(config) {
73
+ root = config.root;
74
+ needHMR = config.command === "serve";
75
+ needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
76
+ }
77
+ },
78
+ resolveId(id) {
79
+ if (id === ssrRegisterHelperId) return id;
80
+ },
81
+ loadInclude(id) {
82
+ if (id === ssrRegisterHelperId) return true;
83
+ },
84
+ load(id) {
85
+ if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
86
+ },
87
+ transformInclude,
88
+ transform(code, id, opt) {
89
+ const result = transformVueJsxVapor(code, opt?.ssr ? normalizePath(relative(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
90
+ if (result?.code) return {
91
+ code: result.code,
92
+ map: result.map ? JSON.parse(result.map) : null
93
+ };
94
+ }
95
+ },
96
+ {
97
+ name: "@vue-macros/jsx-directive",
98
+ transformInclude,
99
+ transform(code, id, opt) {
100
+ if (options.interop || opt?.ssr) return transformJsxDirective(code, id, {
101
+ lib: "vue",
102
+ prefix: "v-",
103
+ version: 3.6
104
+ });
105
+ }
106
+ },
107
+ {
108
+ name: "@vitejs/plugin-vue-jsx",
109
+ transformInclude,
110
+ transform(code, id, opt) {
111
+ if (options.interop || opt?.ssr) return transformVueJsx(code, id, needSourceMap);
112
+ }
113
+ }
114
+ ];
115
+ };
116
+ var raw_default = plugin;
117
+
118
+ //#endregion
119
+ export { raw_default as t };
@@ -0,0 +1,132 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_core = require('./core-BeuKLsFR.cjs');
3
+ let __vue_jsx_vapor_macros_raw = require("@vue-jsx-vapor/macros/raw");
4
+ __vue_jsx_vapor_macros_raw = require_chunk.__toESM(__vue_jsx_vapor_macros_raw);
5
+ let __vue_macros_jsx_directive_api = require("@vue-macros/jsx-directive/api");
6
+ __vue_macros_jsx_directive_api = require_chunk.__toESM(__vue_macros_jsx_directive_api);
7
+ let pathe = require("pathe");
8
+ pathe = require_chunk.__toESM(pathe);
9
+ let unplugin_utils = require("unplugin-utils");
10
+ unplugin_utils = require_chunk.__toESM(unplugin_utils);
11
+ let __babel_core = require("@babel/core");
12
+ __babel_core = require_chunk.__toESM(__babel_core);
13
+ let __babel_plugin_transform_typescript = require("@babel/plugin-transform-typescript");
14
+ __babel_plugin_transform_typescript = require_chunk.__toESM(__babel_plugin_transform_typescript);
15
+ let __vue_babel_plugin_jsx = require("@vue/babel-plugin-jsx");
16
+ __vue_babel_plugin_jsx = require_chunk.__toESM(__vue_babel_plugin_jsx);
17
+
18
+ //#region src/core/ssr.ts
19
+ const ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
20
+ const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\nexport const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
21
+ /**
22
+ * This function is serialized with toString() and evaluated as a virtual
23
+ * module during SSR
24
+ */
25
+ function ssrRegisterHelper(comp, filename) {
26
+ if (typeof comp === "function") comp.__setup = () => {
27
+ const ssrContext = useSSRContext();
28
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
29
+ };
30
+ else {
31
+ const setup = comp.setup;
32
+ comp.setup = (props, ctx) => {
33
+ const ssrContext = useSSRContext();
34
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
35
+ if (setup) return setup(props, ctx);
36
+ };
37
+ }
38
+ }
39
+
40
+ //#endregion
41
+ //#region src/core/vue-jsx.ts
42
+ function transformVueJsx(code, id, needSourceMap = false) {
43
+ const result = (0, __babel_core.transformSync)(code, {
44
+ plugins: [__vue_babel_plugin_jsx.default, ...id.endsWith(".tsx") ? [[__babel_plugin_transform_typescript.default, {
45
+ isTSX: true,
46
+ allowExtensions: true
47
+ }]] : []],
48
+ filename: id,
49
+ sourceMaps: needSourceMap,
50
+ sourceFileName: id,
51
+ babelrc: false,
52
+ configFile: false
53
+ });
54
+ if (result?.code && result.code !== code) return {
55
+ code: result.code,
56
+ map: result.map
57
+ };
58
+ }
59
+
60
+ //#endregion
61
+ //#region src/raw.ts
62
+ const plugin = (options = {}) => {
63
+ const transformInclude = (0, unplugin_utils.createFilter)(options?.include || /\.[cm]?[jt]sx$/, options?.exclude || /node_modules/);
64
+ let root = "";
65
+ let needHMR = false;
66
+ let needSourceMap = false;
67
+ return [
68
+ ...options.macros === false ? [] : options.macros ? [(0, __vue_jsx_vapor_macros_raw.default)(options.macros === true ? void 0 : options.macros)] : [],
69
+ {
70
+ enforce: "pre",
71
+ name: "vue-jsx-vapor",
72
+ vite: {
73
+ config(config) {
74
+ return { define: {
75
+ __VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
76
+ __VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
77
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
78
+ } };
79
+ },
80
+ configResolved(config) {
81
+ root = config.root;
82
+ needHMR = config.command === "serve";
83
+ needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
84
+ }
85
+ },
86
+ resolveId(id) {
87
+ if (id === ssrRegisterHelperId) return id;
88
+ },
89
+ loadInclude(id) {
90
+ if (id === ssrRegisterHelperId) return true;
91
+ },
92
+ load(id) {
93
+ if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
94
+ },
95
+ transformInclude,
96
+ transform(code, id, opt) {
97
+ const result = require_core.transformVueJsxVapor(code, opt?.ssr ? (0, unplugin_utils.normalizePath)((0, pathe.relative)(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
98
+ if (result?.code) return {
99
+ code: result.code,
100
+ map: result.map ? JSON.parse(result.map) : null
101
+ };
102
+ }
103
+ },
104
+ {
105
+ name: "@vue-macros/jsx-directive",
106
+ transformInclude,
107
+ transform(code, id, opt) {
108
+ if (options.interop || opt?.ssr) return (0, __vue_macros_jsx_directive_api.transformJsxDirective)(code, id, {
109
+ lib: "vue",
110
+ prefix: "v-",
111
+ version: 3.6
112
+ });
113
+ }
114
+ },
115
+ {
116
+ name: "@vitejs/plugin-vue-jsx",
117
+ transformInclude,
118
+ transform(code, id, opt) {
119
+ if (options.interop || opt?.ssr) return transformVueJsx(code, id, needSourceMap);
120
+ }
121
+ }
122
+ ];
123
+ };
124
+ var raw_default = plugin;
125
+
126
+ //#endregion
127
+ Object.defineProperty(exports, 'raw_default', {
128
+ enumerable: true,
129
+ get: function () {
130
+ return raw_default;
131
+ }
132
+ });
package/dist/raw.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-C-41-Q2Y.cjs');
3
- const require_raw = require('./raw-B2YMrqwY.cjs');
2
+ require('./core-BeuKLsFR.cjs');
3
+ const require_raw = require('./raw-DG3OYbEe.cjs');
4
4
 
5
5
  exports.default = require_raw.raw_default;
package/dist/raw.d.cts CHANGED
@@ -1,7 +1,6 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
2
  import { UnpluginOptions } from "unplugin";
3
3
 
4
4
  //#region src/raw.d.ts
5
5
  declare const plugin: (options?: Options) => UnpluginOptions[];
6
- //#endregion
7
- export { plugin as default };
6
+ export = plugin;
package/dist/raw.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./options-CBMw6D8V.js";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
2
  import { UnpluginOptions } from "unplugin";
3
3
 
4
4
  //#region src/raw.d.ts
package/dist/raw.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./core-CJgJmh2O.js";
2
- import { raw_default } from "./raw-CWZ5g7Vk.js";
1
+ import "./core-CfhBppKN.js";
2
+ import { t as raw_default } from "./raw-B3KlYN7X.js";
3
3
 
4
4
  export { raw_default as default };
package/dist/rolldown.cjs CHANGED
@@ -1,9 +1,10 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CUT6urMc.cjs');
3
- require('./core-C-41-Q2Y.cjs');
4
- require('./raw-B2YMrqwY.cjs');
5
- const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
6
- const unplugin = require_chunk.__toESM(require("unplugin"));
3
+ require('./core-BeuKLsFR.cjs');
4
+ require('./raw-DG3OYbEe.cjs');
5
+ const require_unplugin = require('./unplugin-6bs2zQro.cjs');
6
+ let unplugin = require("unplugin");
7
+ unplugin = require_chunk.__toESM(unplugin);
7
8
 
8
9
  //#region src/rolldown.ts
9
10
  var rolldown_default = (0, unplugin.createRollupPlugin)(require_unplugin.unpluginFactory);
@@ -1,7 +1,6 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
2
- import * as rollup5 from "rollup";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
+ import * as unplugin0 from "unplugin";
3
3
 
4
4
  //#region src/rolldown.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup5.Plugin<any> | rollup5.Plugin<any>[];
6
- //#endregion
7
- export { _default as default };
5
+ declare const _default: (options?: Options | undefined) => unplugin0.RollupPlugin<any> | unplugin0.RollupPlugin<any>[];
6
+ export = _default;
@@ -1,7 +1,7 @@
1
- import { Options } from "./options-CBMw6D8V.js";
2
- import * as rollup3 from "rollup";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
+ import * as unplugin0 from "unplugin";
3
3
 
4
4
  //#region src/rolldown.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup3.Plugin<any> | rollup3.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => unplugin0.RollupPlugin<any> | unplugin0.RollupPlugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/rolldown.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./core-CJgJmh2O.js";
2
- import "./raw-CWZ5g7Vk.js";
3
- import { unpluginFactory } from "./unplugin-CyifZGPt.js";
1
+ import "./core-CfhBppKN.js";
2
+ import "./raw-B3KlYN7X.js";
3
+ import { n as unpluginFactory } from "./unplugin-BPAlTDcQ.js";
4
4
  import { createRollupPlugin } from "unplugin";
5
5
 
6
6
  //#region src/rolldown.ts
package/dist/rollup.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-C-41-Q2Y.cjs');
3
- require('./raw-B2YMrqwY.cjs');
4
- const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
2
+ require('./core-BeuKLsFR.cjs');
3
+ require('./raw-DG3OYbEe.cjs');
4
+ const require_unplugin = require('./unplugin-6bs2zQro.cjs');
5
5
 
6
6
  //#region src/rollup.ts
7
7
  var rollup_default = require_unplugin.unplugin_default.rollup;
package/dist/rollup.d.cts CHANGED
@@ -1,7 +1,6 @@
1
- import { Options } from "./options-jKAq0dFf.cjs";
2
- import * as rollup13 from "rollup";
1
+ import { t as Options } from "./options-DxHQU8-_.cjs";
2
+ import * as unplugin1 from "unplugin";
3
3
 
4
4
  //#region src/rollup.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup13.Plugin<any>[];
6
- //#endregion
7
- export { _default as default };
5
+ declare const _default: (options?: Options | undefined) => unplugin1.RollupPlugin<any>[];
6
+ export = _default;
package/dist/rollup.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Options } from "./options-CBMw6D8V.js";
2
- import * as rollup1 from "rollup";
1
+ import { t as Options } from "./options-D6zn5V49.js";
2
+ import * as unplugin1 from "unplugin";
3
3
 
4
4
  //#region src/rollup.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup1.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => unplugin1.RollupPlugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./core-CJgJmh2O.js";
2
- import "./raw-CWZ5g7Vk.js";
3
- import { unplugin_default } from "./unplugin-CyifZGPt.js";
1
+ import "./core-CfhBppKN.js";
2
+ import "./raw-B3KlYN7X.js";
3
+ import { r as unplugin_default } from "./unplugin-BPAlTDcQ.js";
4
4
 
5
5
  //#region src/rollup.ts
6
6
  var rollup_default = unplugin_default.rollup;
package/dist/rspack.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-C-41-Q2Y.cjs');
3
- require('./raw-B2YMrqwY.cjs');
4
- const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
2
+ require('./core-BeuKLsFR.cjs');
3
+ require('./raw-DG3OYbEe.cjs');
4
+ const require_unplugin = require('./unplugin-6bs2zQro.cjs');
5
5
 
6
6
  //#region src/rspack.ts
7
7
  var rspack_default = require_unplugin.unplugin_default.rspack;