vue-jsx-vapor 3.0.2 → 3.1.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 (66) hide show
  1. package/README.md +2 -2
  2. package/dist/api.cjs +1 -1
  3. package/dist/api.d.cts +1 -1
  4. package/dist/api.d.ts +1 -1
  5. package/dist/api.js +1 -1
  6. package/dist/astro.cjs +3 -3
  7. package/dist/astro.d.cts +1 -1
  8. package/dist/astro.d.ts +1 -1
  9. package/dist/astro.js +3 -3
  10. package/dist/{chunk-CUT6urMc.cjs → chunk-CbDLau6x.cjs} +10 -6
  11. package/dist/{core-BeuKLsFR.cjs → core-BeIGPz2Y.cjs} +3 -4
  12. package/dist/esbuild.cjs +3 -3
  13. package/dist/esbuild.d.cts +1 -1
  14. package/dist/esbuild.d.ts +1 -1
  15. package/dist/esbuild.js +3 -3
  16. package/dist/index.cjs +3 -3
  17. package/dist/nuxt.cjs +10 -11
  18. package/dist/nuxt.d.cts +1 -1
  19. package/dist/nuxt.d.ts +1 -1
  20. package/dist/nuxt.js +5 -5
  21. package/dist/raw-CzYfWnnD.cjs +96 -0
  22. package/dist/raw-rSj_OSHs.js +89 -0
  23. package/dist/raw.cjs +2 -2
  24. package/dist/raw.d.cts +1 -1
  25. package/dist/raw.d.ts +1 -1
  26. package/dist/raw.js +2 -2
  27. package/dist/rolldown.cjs +4 -5
  28. package/dist/rolldown.d.cts +1 -1
  29. package/dist/rolldown.d.ts +1 -1
  30. package/dist/rolldown.js +3 -3
  31. package/dist/rollup.cjs +3 -3
  32. package/dist/rollup.d.cts +1 -1
  33. package/dist/rollup.d.ts +1 -1
  34. package/dist/rollup.js +3 -3
  35. package/dist/rspack.cjs +3 -3
  36. package/dist/rspack.d.cts +1 -1
  37. package/dist/rspack.d.ts +1 -1
  38. package/dist/rspack.js +3 -3
  39. package/dist/{unplugin-BPAlTDcQ.js → unplugin-Cphty0W0.js} +1 -1
  40. package/dist/{unplugin-6bs2zQro.cjs → unplugin-CrWWgg9F.cjs} +2 -3
  41. package/dist/unplugin.cjs +3 -3
  42. package/dist/unplugin.d.cts +1 -1
  43. package/dist/unplugin.d.ts +1 -1
  44. package/dist/unplugin.js +3 -3
  45. package/dist/vite.cjs +8 -5
  46. package/dist/vite.d.cts +1 -1
  47. package/dist/vite.d.ts +1 -1
  48. package/dist/vite.js +7 -4
  49. package/dist/volar.cjs +12 -14
  50. package/dist/volar.d.cts +1 -1
  51. package/dist/volar.d.ts +1 -1
  52. package/dist/webpack.cjs +8 -5
  53. package/dist/webpack.d.cts +1 -1
  54. package/dist/webpack.d.ts +1 -1
  55. package/dist/webpack.js +7 -4
  56. package/jsx-runtime/index.cjs +1 -1
  57. package/package.json +26 -33
  58. package/dist/raw-B3KlYN7X.js +0 -119
  59. package/dist/raw-DG3OYbEe.cjs +0 -132
  60. package/dist/vite-D8MCYNCu.cjs +0 -12
  61. package/dist/vite-EGcRF3B5.js +0 -7
  62. package/dist/webpack-CAtjl4UN.cjs +0 -12
  63. package/dist/webpack-DdK9_Sb1.js +0 -7
  64. /package/dist/{core-CfhBppKN.js → core-CgC9S6Q0.js} +0 -0
  65. /package/dist/{options-DxHQU8-_.d.cts → options-V1045xYK.d.cts} +0 -0
  66. /package/dist/{options-D6zn5V49.d.ts → options-gD_zG4x2.d.ts} +0 -0
package/dist/vite.cjs CHANGED
@@ -1,7 +1,10 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-BeuKLsFR.cjs');
3
- require('./raw-DG3OYbEe.cjs');
4
- require('./unplugin-6bs2zQro.cjs');
5
- const require_vite = require('./vite-D8MCYNCu.cjs');
2
+ require('./core-BeIGPz2Y.cjs');
3
+ require('./raw-CzYfWnnD.cjs');
4
+ const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
6
5
 
7
- exports.default = require_vite.vite_default;
6
+ //#region src/vite.ts
7
+ var vite_default = require_unplugin.unplugin_default.vite;
8
+
9
+ //#endregion
10
+ exports.default = vite_default;
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-DxHQU8-_.cjs";
1
+ import { t as Options } from "./options-V1045xYK.cjs";
2
2
  import * as vite0 from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-D6zn5V49.js";
1
+ import { t as Options } from "./options-gD_zG4x2.js";
2
2
  import * as vite0 from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
package/dist/vite.js CHANGED
@@ -1,6 +1,9 @@
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";
1
+ import "./core-CgC9S6Q0.js";
2
+ import "./raw-rSj_OSHs.js";
3
+ import { r as unplugin_default } from "./unplugin-Cphty0W0.js";
5
4
 
5
+ //#region src/vite.ts
6
+ var vite_default = unplugin_default.vite;
7
+
8
+ //#endregion
6
9
  export { vite_default as default };
package/dist/volar.cjs CHANGED
@@ -1,15 +1,13 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_chunk = require('./chunk-CUT6urMc.cjs');
3
- let __vue_jsx_vapor_macros_volar = require("@vue-jsx-vapor/macros/volar");
4
- __vue_jsx_vapor_macros_volar = require_chunk.__toESM(__vue_jsx_vapor_macros_volar);
5
- let __vue_macros_volar_jsx_directive = require("@vue-macros/volar/jsx-directive");
6
- __vue_macros_volar_jsx_directive = require_chunk.__toESM(__vue_macros_volar_jsx_directive);
7
- let __vue_macros_volar_jsx_ref = require("@vue-macros/volar/jsx-ref");
8
- __vue_macros_volar_jsx_ref = require_chunk.__toESM(__vue_macros_volar_jsx_ref);
2
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
3
+ let _vue_jsx_vapor_macros_volar = require("@vue-jsx-vapor/macros/volar");
4
+ _vue_jsx_vapor_macros_volar = require_chunk.__toESM(_vue_jsx_vapor_macros_volar);
5
+ let _vue_macros_volar_jsx_directive = require("@vue-macros/volar/jsx-directive");
6
+ _vue_macros_volar_jsx_directive = require_chunk.__toESM(_vue_macros_volar_jsx_directive);
7
+ let _vue_macros_volar_jsx_ref = require("@vue-macros/volar/jsx-ref");
8
+ _vue_macros_volar_jsx_ref = require_chunk.__toESM(_vue_macros_volar_jsx_ref);
9
9
  let ts_macro = require("ts-macro");
10
- ts_macro = require_chunk.__toESM(ts_macro);
11
- let __vue_shared = require("@vue/shared");
12
- __vue_shared = require_chunk.__toESM(__vue_shared);
10
+ let _vue_shared = require("@vue/shared");
13
11
 
14
12
  //#region src/volar/jsx-element.ts
15
13
  var jsx_element_default = (0, ts_macro.createPlugin)(({ ts }) => {
@@ -25,7 +23,7 @@ var jsx_element_default = (0, ts_macro.createPlugin)(({ ts }) => {
25
23
  if (!tagName.includes("-")) {
26
24
  transformed = true;
27
25
  codes.replaceRange(node.getStart(ast), node.getStart(ast) + 1, "(<");
28
- codes.replaceRange(node.end, node.end, " as unknown as __InferJsxElement<", (0, __vue_shared.isHTMLTag)(tagName) || (0, __vue_shared.isSVGTag)(tagName) ? `'${tagName}'` : `typeof ${tagName}`, ">)");
26
+ codes.replaceRange(node.end, node.end, " as unknown as __InferJsxElement<", (0, _vue_shared.isHTMLTag)(tagName) || (0, _vue_shared.isSVGTag)(tagName) ? `'${tagName}'` : `typeof ${tagName}`, ">)");
29
27
  }
30
28
  }
31
29
  }
@@ -56,9 +54,9 @@ function isConditionalExpression(ts, node) {
56
54
  //#region src/volar.ts
57
55
  const plugin = (0, ts_macro.createPlugin)((ctx, options = ctx.vueCompilerOptions?.["vue-jsx-vapor"]) => {
58
56
  return [
59
- (0, __vue_macros_volar_jsx_directive.default)()(ctx),
60
- options?.ref === false ? [] : (0, __vue_macros_volar_jsx_ref.default)(options?.ref === true ? void 0 : options?.ref)(ctx),
61
- options?.macros === false ? [] : options?.macros ? (0, __vue_jsx_vapor_macros_volar.default)(options.macros === true ? void 0 : options.macros)(ctx) : [],
57
+ (0, _vue_macros_volar_jsx_directive.default)()(ctx),
58
+ options?.ref === false ? [] : (0, _vue_macros_volar_jsx_ref.default)(options?.ref === true ? void 0 : options?.ref)(ctx),
59
+ options?.macros === false ? [] : options?.macros ? (0, _vue_jsx_vapor_macros_volar.default)(options.macros === true ? void 0 : options.macros)(ctx) : [],
62
60
  options?.interop ? [] : jsx_element_default()(ctx)
63
61
  ].flat();
64
62
  });
package/dist/volar.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-DxHQU8-_.cjs";
1
+ import { t as Options } from "./options-V1045xYK.cjs";
2
2
  import { PluginReturn } from "ts-macro";
3
3
 
4
4
  //#region src/volar.d.ts
package/dist/volar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-D6zn5V49.js";
1
+ import { t as Options } from "./options-gD_zG4x2.js";
2
2
  import { PluginReturn } from "ts-macro";
3
3
 
4
4
  //#region src/volar.d.ts
package/dist/webpack.cjs CHANGED
@@ -1,7 +1,10 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-BeuKLsFR.cjs');
3
- require('./raw-DG3OYbEe.cjs');
4
- require('./unplugin-6bs2zQro.cjs');
5
- const require_webpack = require('./webpack-CAtjl4UN.cjs');
2
+ require('./core-BeIGPz2Y.cjs');
3
+ require('./raw-CzYfWnnD.cjs');
4
+ const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
6
5
 
7
- exports.default = require_webpack.webpack_default;
6
+ //#region src/webpack.ts
7
+ var webpack_default = require_unplugin.unplugin_default.webpack;
8
+
9
+ //#endregion
10
+ exports.default = webpack_default;
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-DxHQU8-_.cjs";
1
+ import { t as Options } from "./options-V1045xYK.cjs";
2
2
  import * as webpack0 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
package/dist/webpack.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-D6zn5V49.js";
1
+ import { t as Options } from "./options-gD_zG4x2.js";
2
2
  import * as webpack0 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
package/dist/webpack.js CHANGED
@@ -1,6 +1,9 @@
1
- import "./core-CfhBppKN.js";
2
- import "./raw-B3KlYN7X.js";
3
- import "./unplugin-BPAlTDcQ.js";
4
- import { t as webpack_default } from "./webpack-DdK9_Sb1.js";
1
+ import "./core-CgC9S6Q0.js";
2
+ import "./raw-rSj_OSHs.js";
3
+ import { r as unplugin_default } from "./unplugin-Cphty0W0.js";
5
4
 
5
+ //#region src/webpack.ts
6
+ var webpack_default = unplugin_default.webpack;
7
+
8
+ //#endregion
6
9
  export { webpack_default as default };
@@ -22,7 +22,7 @@ const __copyProps = (to, from, except, desc) => {
22
22
  return to
23
23
  }
24
24
  const __toESM = (mod, isNodeMode, target) => (
25
- (target = mod != null ? __create(__getProtoOf(mod)) : {}),
25
+ (target = mod == null ? {} : __create(__getProtoOf(mod))),
26
26
  __copyProps(
27
27
  isNodeMode || !mod || !mod.__esModule
28
28
  ? __defProp(target, 'default', {
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "vue-jsx-vapor",
3
- "version": "3.0.2",
4
- "description": "Vapor Mode of Vue JSX",
5
3
  "type": "module",
4
+ "version": "3.1.0",
5
+ "description": "Vapor Mode of Vue JSX",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/vuejs/vue-jsx-vapor#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/vuejs/vue-jsx-vapor.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/vuejs/vue-jsx-vapor/issues"
14
+ },
6
15
  "keywords": [
7
16
  "unplugin",
8
17
  "vite",
@@ -13,22 +22,6 @@
13
22
  "volar",
14
23
  "vapor"
15
24
  ],
16
- "license": "MIT",
17
- "homepage": "https://github.com/vuejs/vue-jsx-vapor#readme",
18
- "bugs": {
19
- "url": "https://github.com/vuejs/vue-jsx-vapor/issues"
20
- },
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/vuejs/vue-jsx-vapor.git"
24
- },
25
- "files": [
26
- "dist",
27
- "jsx-runtime"
28
- ],
29
- "main": "dist/index.cjs",
30
- "module": "dist/index.js",
31
- "types": "dist/index.d.ts",
32
25
  "exports": {
33
26
  ".": {
34
27
  "types": "./dist/index.d.ts",
@@ -120,6 +113,9 @@
120
113
  },
121
114
  "./*": "./*"
122
115
  },
116
+ "main": "dist/index.cjs",
117
+ "module": "dist/index.js",
118
+ "types": "dist/index.d.ts",
123
119
  "typesVersions": {
124
120
  "*": {
125
121
  "*": [
@@ -131,6 +127,10 @@
131
127
  ]
132
128
  }
133
129
  },
130
+ "files": [
131
+ "dist",
132
+ "jsx-runtime"
133
+ ],
134
134
  "peerDependencies": {
135
135
  "@nuxt/kit": "^3",
136
136
  "@nuxt/schema": "^3",
@@ -161,26 +161,19 @@
161
161
  }
162
162
  },
163
163
  "dependencies": {
164
- "@babel/core": "^7.28.4",
165
- "@babel/plugin-transform-typescript": "^7.28.0",
166
- "@vue-macros/jsx-directive": "^3.0.1",
167
- "@vue-macros/volar": "^3.0.1",
168
- "@vue/babel-plugin-jsx": "^1.5.0",
169
- "@vue/shared": "3.6.0-alpha.2",
170
- "hash-sum": "^2.0.0",
164
+ "@vue-macros/volar": "^3.1.1",
165
+ "@vue/shared": "3.6.0-alpha.7",
171
166
  "pathe": "^2.0.3",
172
167
  "ts-macro": "^0.3.6",
173
- "unplugin": "^2.3.10",
168
+ "unplugin": "^2.3.11",
174
169
  "unplugin-utils": "^0.2.5",
175
- "@vue-jsx-vapor/macros": "3.0.2",
176
- "@vue-jsx-vapor/compiler-rs": "3.0.2",
177
- "@vue-jsx-vapor/runtime": "3.0.2"
170
+ "@vue-jsx-vapor/macros": "3.1.0",
171
+ "@vue-jsx-vapor/runtime": "3.1.0",
172
+ "@vue-jsx-vapor/compiler-rs": "3.1.0"
178
173
  },
179
174
  "devDependencies": {
180
- "@nuxt/kit": "^3.19.2",
181
- "@nuxt/schema": "^3.19.2",
182
- "@types/babel__core": "^7.20.5",
183
- "@types/hash-sum": "^1.0.2"
175
+ "@nuxt/kit": "^3.20.2",
176
+ "@nuxt/schema": "^3.20.2"
184
177
  },
185
178
  "scripts": {
186
179
  "build": "tsdown",
@@ -1,119 +0,0 @@
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 };
@@ -1,132 +0,0 @@
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
- });
@@ -1,12 +0,0 @@
1
- const require_unplugin = require('./unplugin-6bs2zQro.cjs');
2
-
3
- //#region src/vite.ts
4
- var vite_default = require_unplugin.unplugin_default.vite;
5
-
6
- //#endregion
7
- Object.defineProperty(exports, 'vite_default', {
8
- enumerable: true,
9
- get: function () {
10
- return vite_default;
11
- }
12
- });
@@ -1,7 +0,0 @@
1
- import { r as unplugin_default } from "./unplugin-BPAlTDcQ.js";
2
-
3
- //#region src/vite.ts
4
- var vite_default = unplugin_default.vite;
5
-
6
- //#endregion
7
- export { vite_default as t };
@@ -1,12 +0,0 @@
1
- const require_unplugin = require('./unplugin-6bs2zQro.cjs');
2
-
3
- //#region src/webpack.ts
4
- var webpack_default = require_unplugin.unplugin_default.webpack;
5
-
6
- //#endregion
7
- Object.defineProperty(exports, 'webpack_default', {
8
- enumerable: true,
9
- get: function () {
10
- return webpack_default;
11
- }
12
- });
@@ -1,7 +0,0 @@
1
- import { r as unplugin_default } from "./unplugin-BPAlTDcQ.js";
2
-
3
- //#region src/webpack.ts
4
- var webpack_default = unplugin_default.webpack;
5
-
6
- //#endregion
7
- export { webpack_default as t };
File without changes