vue-jsx-vapor 2.1.7 → 2.2.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.
Files changed (41) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.d.cts +2 -12
  3. package/dist/api.d.ts +2 -12
  4. package/dist/api.js +1 -1
  5. package/dist/astro.cjs +4 -4
  6. package/dist/astro.js +3 -3
  7. package/dist/{chunk-E4OOBQM6.js → chunk-4HP6QVER.js} +1 -1
  8. package/dist/{chunk-JOQ6HUZ7.cjs → chunk-F7CI4ATH.cjs} +2 -2
  9. package/dist/{chunk-G5FQVEHY.js → chunk-G2KD2VHX.js} +1 -1
  10. package/dist/chunk-GY6DSRCV.cjs +22 -0
  11. package/dist/{chunk-WKWVDEIZ.js → chunk-HNBQ42EP.js} +1 -1
  12. package/dist/{chunk-4FRXY2W6.cjs → chunk-M4VKLZSB.cjs} +2 -2
  13. package/dist/{chunk-WAOMEMCZ.cjs → chunk-QBIU4H54.cjs} +2 -2
  14. package/dist/chunk-SAJ6WS2A.js +22 -0
  15. package/dist/chunk-T3F6TYMY.js +265 -0
  16. package/dist/chunk-VSS2IZIS.cjs +265 -0
  17. package/dist/esbuild.cjs +4 -4
  18. package/dist/esbuild.js +3 -3
  19. package/dist/nuxt.cjs +7 -7
  20. package/dist/nuxt.js +5 -5
  21. package/dist/raw.cjs +3 -3
  22. package/dist/raw.js +2 -2
  23. package/dist/rolldown.cjs +4 -4
  24. package/dist/rolldown.d.cts +1 -1
  25. package/dist/rolldown.d.ts +1 -1
  26. package/dist/rolldown.js +3 -3
  27. package/dist/rollup.cjs +4 -4
  28. package/dist/rollup.js +3 -3
  29. package/dist/rspack.cjs +4 -4
  30. package/dist/rspack.js +3 -3
  31. package/dist/unplugin.cjs +4 -4
  32. package/dist/unplugin.js +3 -3
  33. package/dist/vite.cjs +5 -5
  34. package/dist/vite.js +4 -4
  35. package/dist/webpack.cjs +5 -5
  36. package/dist/webpack.js +4 -4
  37. package/package.json +8 -5
  38. package/dist/chunk-CVVA3UFV.cjs +0 -58
  39. package/dist/chunk-GY27NIU6.cjs +0 -134
  40. package/dist/chunk-K7YI4ZKB.js +0 -134
  41. package/dist/chunk-MBCYFLIE.js +0 -58
package/dist/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkGY27NIU6cjs = require('./chunk-GY27NIU6.cjs');
3
+ var _chunkGY6DSRCVcjs = require('./chunk-GY6DSRCV.cjs');
4
4
 
5
5
 
6
- exports.transformVueJsxVapor = _chunkGY27NIU6cjs.transformVueJsxVapor;
6
+ exports.transformVueJsxVapor = _chunkGY6DSRCVcjs.transformVueJsxVapor;
package/dist/api.d.cts CHANGED
@@ -1,19 +1,9 @@
1
+ import * as _babel_core from '@babel/core';
1
2
  import { Options } from './options.cjs';
2
3
  import '@vue-jsx-vapor/compiler';
3
4
  import '@vue-jsx-vapor/macros';
4
5
  import 'unplugin-utils';
5
6
 
6
- declare function transformVueJsxVapor(code: string, id: string, options?: Options): {
7
- code: string;
8
- map: {
9
- version: number;
10
- sources: string[];
11
- names: string[];
12
- sourceRoot?: string | undefined;
13
- sourcesContent?: string[] | undefined;
14
- mappings: string;
15
- file: string;
16
- } | null | undefined;
17
- } | undefined;
7
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): _babel_core.BabelFileResult | null;
18
8
 
19
9
  export { Options, transformVueJsxVapor };
package/dist/api.d.ts CHANGED
@@ -1,19 +1,9 @@
1
+ import * as _babel_core from '@babel/core';
1
2
  import { Options } from './options.js';
2
3
  import '@vue-jsx-vapor/compiler';
3
4
  import '@vue-jsx-vapor/macros';
4
5
  import 'unplugin-utils';
5
6
 
6
- declare function transformVueJsxVapor(code: string, id: string, options?: Options): {
7
- code: string;
8
- map: {
9
- version: number;
10
- sources: string[];
11
- names: string[];
12
- sourceRoot?: string | undefined;
13
- sourcesContent?: string[] | undefined;
14
- mappings: string;
15
- file: string;
16
- } | null | undefined;
17
- } | undefined;
7
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): _babel_core.BabelFileResult | null;
18
8
 
19
9
  export { Options, transformVueJsxVapor };
package/dist/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  transformVueJsxVapor
3
- } from "./chunk-K7YI4ZKB.js";
3
+ } from "./chunk-SAJ6WS2A.js";
4
4
  export {
5
5
  transformVueJsxVapor
6
6
  };
package/dist/astro.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJOQ6HUZ7cjs = require('./chunk-JOQ6HUZ7.cjs');
3
+ var _chunkF7CI4ATHcjs = require('./chunk-F7CI4ATH.cjs');
4
4
  require('./chunk-GODVM7NB.cjs');
5
- require('./chunk-CVVA3UFV.cjs');
6
- require('./chunk-GY27NIU6.cjs');
5
+ require('./chunk-VSS2IZIS.cjs');
6
+ require('./chunk-GY6DSRCV.cjs');
7
7
 
8
8
  // src/astro.ts
9
9
  var astro_default = (options) => ({
@@ -11,7 +11,7 @@ var astro_default = (options) => ({
11
11
  hooks: {
12
12
  "astro:config:setup": (astro) => {
13
13
  astro.config.vite.plugins ||= [];
14
- astro.config.vite.plugins.push(_chunkJOQ6HUZ7cjs.unplugin_default.vite(options));
14
+ astro.config.vite.plugins.push(_chunkF7CI4ATHcjs.unplugin_default.vite(options));
15
15
  }
16
16
  }
17
17
  });
package/dist/astro.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-G5FQVEHY.js";
3
+ } from "./chunk-G2KD2VHX.js";
4
4
  import "./chunk-JNAGPWSX.js";
5
- import "./chunk-MBCYFLIE.js";
6
- import "./chunk-K7YI4ZKB.js";
5
+ import "./chunk-T3F6TYMY.js";
6
+ import "./chunk-SAJ6WS2A.js";
7
7
 
8
8
  // src/astro.ts
9
9
  var astro_default = (options) => ({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-G5FQVEHY.js";
3
+ } from "./chunk-G2KD2VHX.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  var webpack_default = unplugin_default.webpack;
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkCVVA3UFVcjs = require('./chunk-CVVA3UFV.cjs');
3
+ var _chunkVSS2IZIScjs = require('./chunk-VSS2IZIS.cjs');
4
4
 
5
5
  // src/unplugin.ts
6
6
  var _unplugin = require('unplugin');
7
7
  var _vite = require('vite');
8
8
  var unpluginFactory = (options = {}) => {
9
9
  return [
10
- ..._chunkCVVA3UFVcjs.raw_default.call(void 0, options),
10
+ ..._chunkVSS2IZIScjs.raw_default.call(void 0, options),
11
11
  options.interop ? { name: "interop" } : {
12
12
  name: "unplugin-esbuild",
13
13
  transformInclude: _vite.createFilter.call(void 0,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raw_default
3
- } from "./chunk-MBCYFLIE.js";
3
+ } from "./chunk-T3F6TYMY.js";
4
4
 
5
5
  // src/unplugin.ts
6
6
  import { createUnplugin } from "unplugin";
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/core/index.ts
2
+ var _core = require('@babel/core');
3
+ var _plugintransformtypescript = require('@babel/plugin-transform-typescript'); var _plugintransformtypescript2 = _interopRequireDefault(_plugintransformtypescript);
4
+ var _babel = require('@vue-jsx-vapor/babel'); var _babel2 = _interopRequireDefault(_babel);
5
+ function transformVueJsxVapor(code, id, options, needSourceMap = false) {
6
+ return _core.transformSync.call(void 0, code, {
7
+ plugins: [
8
+ [_babel2.default, { compile: _optionalChain([options, 'optionalAccess', _ => _.compile]), interop: _optionalChain([options, 'optionalAccess', _2 => _2.interop]) }],
9
+ ...id.endsWith(".tsx") ? [[_plugintransformtypescript2.default, { isTSX: true, allowExtensions: true }]] : []
10
+ ],
11
+ filename: id,
12
+ sourceMaps: needSourceMap,
13
+ sourceFileName: id,
14
+ babelrc: false,
15
+ configFile: false,
16
+ ast: true
17
+ });
18
+ }
19
+
20
+
21
+
22
+ exports.transformVueJsxVapor = transformVueJsxVapor;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-G5FQVEHY.js";
3
+ } from "./chunk-G2KD2VHX.js";
4
4
 
5
5
  // src/vite.ts
6
6
  var vite_default = unplugin_default.vite;
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJOQ6HUZ7cjs = require('./chunk-JOQ6HUZ7.cjs');
3
+ var _chunkF7CI4ATHcjs = require('./chunk-F7CI4ATH.cjs');
4
4
 
5
5
  // src/vite.ts
6
- var vite_default = _chunkJOQ6HUZ7cjs.unplugin_default.vite;
6
+ var vite_default = _chunkF7CI4ATHcjs.unplugin_default.vite;
7
7
 
8
8
 
9
9
 
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJOQ6HUZ7cjs = require('./chunk-JOQ6HUZ7.cjs');
3
+ var _chunkF7CI4ATHcjs = require('./chunk-F7CI4ATH.cjs');
4
4
 
5
5
  // src/webpack.ts
6
- var webpack_default = _chunkJOQ6HUZ7cjs.unplugin_default.webpack;
6
+ var webpack_default = _chunkF7CI4ATHcjs.unplugin_default.webpack;
7
7
 
8
8
 
9
9
 
@@ -0,0 +1,22 @@
1
+ // src/core/index.ts
2
+ import { transformSync } from "@babel/core";
3
+ import babelTypescript from "@babel/plugin-transform-typescript";
4
+ import jsx from "@vue-jsx-vapor/babel";
5
+ function transformVueJsxVapor(code, id, options, needSourceMap = false) {
6
+ return transformSync(code, {
7
+ plugins: [
8
+ [jsx, { compile: options?.compile, interop: options?.interop }],
9
+ ...id.endsWith(".tsx") ? [[babelTypescript, { isTSX: true, allowExtensions: true }]] : []
10
+ ],
11
+ filename: id,
12
+ sourceMaps: needSourceMap,
13
+ sourceFileName: id,
14
+ babelrc: false,
15
+ configFile: false,
16
+ ast: true
17
+ });
18
+ }
19
+
20
+ export {
21
+ transformVueJsxVapor
22
+ };
@@ -0,0 +1,265 @@
1
+ import {
2
+ transformVueJsxVapor
3
+ } from "./chunk-SAJ6WS2A.js";
4
+
5
+ // src/raw.ts
6
+ import macros from "@vue-jsx-vapor/macros/raw";
7
+ import { transformJsxDirective } from "@vue-macros/jsx-directive/api";
8
+ import { createFilter, normalizePath as normalizePath2 } from "unplugin-utils";
9
+
10
+ // src/core/hmr.ts
11
+ import { isFunctionalNode } from "@vue-jsx-vapor/macros/api";
12
+ import getHash from "hash-sum";
13
+
14
+ // src/core/ssr.ts
15
+ import { relative } from "pathe";
16
+ import { normalizePath } from "unplugin-utils";
17
+ var ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
18
+ var ssrRegisterHelperCode = `import { useSSRContext } from "vue"
19
+ export const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
20
+ function ssrRegisterHelper(comp, filename) {
21
+ const setup = comp.setup;
22
+ comp.setup = (props, ctx) => {
23
+ const ssrContext = useSSRContext();
24
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
25
+ if (setup) {
26
+ return setup(props, ctx);
27
+ }
28
+ };
29
+ }
30
+ function injectSSR(id, hotComponents, root = "") {
31
+ const normalizedId = normalizePath(relative(root, id));
32
+ let ssrInjectCode = `
33
+ import { ssrRegisterHelper } from "${ssrRegisterHelperId}"
34
+ const __moduleId = ${JSON.stringify(normalizedId)}`;
35
+ for (const { local } of hotComponents) {
36
+ ssrInjectCode += `
37
+ ssrRegisterHelper(${local}, __moduleId)`;
38
+ }
39
+ return ssrInjectCode;
40
+ }
41
+
42
+ // src/core/hmr.ts
43
+ function injectHMRAndSSR(result, id, options) {
44
+ const ssr = options?.ssr;
45
+ const defineComponentNames = options?.defineComponentNames ?? [
46
+ "defineComponent",
47
+ "defineVaporComponent"
48
+ ];
49
+ const { ast } = result;
50
+ const declaredComponents = [];
51
+ const hotComponents = [];
52
+ let hasDefaultExport = false;
53
+ for (const node of ast.program.body) {
54
+ if (node.type === "VariableDeclaration") {
55
+ const names = parseComponentDecls(node, defineComponentNames);
56
+ if (names.length) {
57
+ declaredComponents.push(...names);
58
+ }
59
+ }
60
+ if (node.type === "ExportNamedDeclaration") {
61
+ if (node.declaration && node.declaration.type === "VariableDeclaration") {
62
+ hotComponents.push(
63
+ ...parseComponentDecls(node.declaration, defineComponentNames).map(
64
+ (name) => ({
65
+ local: name,
66
+ exported: name,
67
+ id: getHash(id + name)
68
+ })
69
+ )
70
+ );
71
+ } else if (node.specifiers.length) {
72
+ for (const spec of node.specifiers) {
73
+ if (spec.type === "ExportSpecifier" && spec.exported.type === "Identifier") {
74
+ const matched = declaredComponents.find(
75
+ (name) => name === spec.local.name
76
+ );
77
+ if (matched) {
78
+ hotComponents.push({
79
+ local: spec.local.name,
80
+ exported: spec.exported.name,
81
+ id: getHash(id + spec.exported.name)
82
+ });
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ if (node.type === "ExportDefaultDeclaration") {
89
+ if (node.declaration.type === "Identifier") {
90
+ const _name = node.declaration.name;
91
+ const matched = declaredComponents.find((name) => name === _name);
92
+ if (matched) {
93
+ hotComponents.push({
94
+ local: _name,
95
+ exported: "default",
96
+ id: getHash(`${id}default`)
97
+ });
98
+ }
99
+ } else if (isDefineComponentCall(node.declaration, defineComponentNames) || isFunctionalNode(node.declaration)) {
100
+ hasDefaultExport = true;
101
+ hotComponents.push({
102
+ local: "__default__",
103
+ exported: "default",
104
+ id: getHash(`${id}default`)
105
+ });
106
+ }
107
+ }
108
+ }
109
+ if (hotComponents.length) {
110
+ if (hasDefaultExport || ssr) {
111
+ result.code = `${result.code.replaceAll(
112
+ `export default `,
113
+ `const __default__ = `
114
+ )}
115
+ export default __default__`;
116
+ }
117
+ if (!ssr && !/\?vue&type=script/.test(id)) {
118
+ let code = result.code;
119
+ let callbackCode = ``;
120
+ for (const { local, exported, id: id2 } of hotComponents) {
121
+ code += `
122
+ ${local}.__hmrId = "${id2}"
123
+ __VUE_HMR_RUNTIME__.createRecord("${id2}", ${local})`;
124
+ callbackCode += `
125
+ __VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}'].setup || mod['${exported}'])`;
126
+ }
127
+ code += `
128
+ if (import.meta.hot) {
129
+ import.meta.hot.accept((mod) => {${callbackCode}
130
+ })
131
+ }`;
132
+ result.code = code;
133
+ }
134
+ if (ssr) {
135
+ result.code += injectSSR(id, hotComponents, options?.root);
136
+ }
137
+ }
138
+ }
139
+ function parseComponentDecls(node, fnNames) {
140
+ const names = [];
141
+ for (const decl of node.declarations) {
142
+ if (decl.id.type === "Identifier" && (isDefineComponentCall(decl.init, fnNames) || isFunctionalNode(decl.init)))
143
+ names.push(decl.id.name);
144
+ }
145
+ return names;
146
+ }
147
+ function isDefineComponentCall(node, names) {
148
+ return !!(node && node.type === "CallExpression" && node.callee.type === "Identifier" && names.includes(node.callee.name));
149
+ }
150
+
151
+ // src/core/runtime.ts?raw
152
+ var runtime_default = 'import {\n effectScope,\n insert,\n isFragment,\n remove,\n renderEffect,\n VaporFragment\n} from "vue";\nexport { shallowRef as useRef } from "vue";\nfunction createFragment(nodes, anchor = document.createTextNode("")) {\n const frag = new VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeValue(value, anchor) {\n if (value instanceof Node || isFragment(value)) {\n anchor && (anchor.textContent = "");\n return value;\n } else if (Array.isArray(value)) {\n anchor && (anchor.textContent = "");\n return createFragment(\n value.map((i) => normalizeValue(i)),\n anchor\n );\n } else {\n const result = value == null || typeof value === "boolean" ? "" : String(value);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor) {\n const node = normalizeValue(value, anchor);\n if (current) {\n if (isFragment(current)) {\n const { anchor: anchor2 } = current;\n if (anchor2 && anchor2.parentNode) {\n remove(current.nodes, anchor2.parentNode);\n insert(node, anchor2.parentNode, anchor2);\n anchor2.remove();\n }\n } else if (current instanceof Node) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.remove();\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === "function") {\n renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = effectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n anchor.parentNode && insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n';
153
+
154
+ // src/core/vue-jsx.ts
155
+ import { transformSync } from "@babel/core";
156
+ import babelTypescript from "@babel/plugin-transform-typescript";
157
+ import jsx from "@vue/babel-plugin-jsx";
158
+ function transformVueJsx(code, id, needSourceMap = false) {
159
+ const result = transformSync(code, {
160
+ plugins: [
161
+ jsx,
162
+ ...id.endsWith(".tsx") ? [[babelTypescript, { isTSX: true, allowExtensions: true }]] : []
163
+ ],
164
+ filename: id,
165
+ sourceMaps: needSourceMap,
166
+ sourceFileName: id,
167
+ babelrc: false,
168
+ configFile: false
169
+ });
170
+ if (result?.code) {
171
+ return {
172
+ code: result.code,
173
+ map: result.map
174
+ };
175
+ }
176
+ }
177
+
178
+ // src/raw.ts
179
+ var plugin = (options = {}) => {
180
+ const transformInclude = createFilter(
181
+ options?.include || /\.[cm]?[jt]sx$/,
182
+ options?.exclude || /node_modules/
183
+ );
184
+ let root = "";
185
+ let needHMR = false;
186
+ let needSourceMap = false;
187
+ return [
188
+ {
189
+ name: "vue-jsx-vapor",
190
+ vite: {
191
+ config(config) {
192
+ return {
193
+ // only apply esbuild to ts files
194
+ // since we are handling jsx and tsx now
195
+ esbuild: {
196
+ include: /\.ts$/
197
+ },
198
+ define: {
199
+ __VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
200
+ __VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
201
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
202
+ }
203
+ };
204
+ },
205
+ configResolved(config) {
206
+ root = config.root;
207
+ needHMR = config.command === "serve";
208
+ needSourceMap = config.command === "serve" || !!config.build.sourcemap;
209
+ }
210
+ },
211
+ resolveId(id) {
212
+ if (id === ssrRegisterHelperId) return id;
213
+ if (normalizePath2(id) === "vue-jsx-vapor/runtime") return id;
214
+ },
215
+ loadInclude(id) {
216
+ if (id === ssrRegisterHelperId) return true;
217
+ return normalizePath2(id) === "vue-jsx-vapor/runtime";
218
+ },
219
+ load(id) {
220
+ if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
221
+ if (normalizePath2(id) === "vue-jsx-vapor/runtime") return runtime_default;
222
+ },
223
+ transformInclude,
224
+ transform(code, id, opt) {
225
+ const result = transformVueJsxVapor(code, id, options, needSourceMap);
226
+ if (result?.code) {
227
+ ;
228
+ (needHMR || opt?.ssr) && injectHMRAndSSR(result, id, { ssr: opt?.ssr, root });
229
+ return {
230
+ code: result.code,
231
+ map: result.map
232
+ };
233
+ }
234
+ }
235
+ },
236
+ {
237
+ name: "@vue-macros/jsx-directive",
238
+ transformInclude,
239
+ transform(code, id, opt) {
240
+ if (options.interop || opt?.ssr) {
241
+ return transformJsxDirective(code, id, {
242
+ lib: "vue",
243
+ prefix: "v-",
244
+ version: 3.6
245
+ });
246
+ }
247
+ }
248
+ },
249
+ {
250
+ name: "@vitejs/plugin-vue-jsx",
251
+ transformInclude,
252
+ transform(code, id, opt) {
253
+ if (options.interop || opt?.ssr) {
254
+ return transformVueJsx(code, id, needSourceMap);
255
+ }
256
+ }
257
+ },
258
+ ...options.macros === false ? [] : options.macros ? [macros(options.macros === true ? void 0 : options.macros)] : []
259
+ ];
260
+ };
261
+ var raw_default = plugin;
262
+
263
+ export {
264
+ raw_default
265
+ };