vue-jsx-vapor 2.6.8 → 2.7.3
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/api.cjs +1 -1
- package/dist/api.d.cts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.js +1 -1
- package/dist/astro.cjs +3 -3
- package/dist/astro.d.cts +2 -3
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +3 -3
- package/dist/core-BeuKLsFR.cjs +22 -0
- package/dist/core-CfhBppKN.js +15 -0
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.d.cts +4 -5
- package/dist/esbuild.d.ts +3 -3
- package/dist/esbuild.js +3 -3
- package/dist/index.js +2 -0
- package/dist/nuxt.cjs +7 -6
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.ts +3 -3
- package/dist/nuxt.js +5 -5
- package/dist/{options-CBMw6D8V.d.ts → options-D6zn5V49.d.ts} +1 -1
- package/dist/{options-jKAq0dFf.d.cts → options-DxHQU8-_.d.cts} +1 -1
- package/dist/raw-D8DIsSla.js +119 -0
- package/dist/raw-sUsbkvbl.cjs +132 -0
- package/dist/raw.cjs +2 -2
- package/dist/raw.d.cts +2 -3
- package/dist/raw.d.ts +1 -1
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +5 -4
- package/dist/rolldown.d.cts +4 -5
- package/dist/rolldown.d.ts +3 -3
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +4 -5
- package/dist/rollup.d.ts +3 -3
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.d.cts +2 -3
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +3 -3
- package/dist/{unplugin-CyifZGPt.js → unplugin-Bgf_17my.js} +2 -2
- package/dist/{unplugin-aKVZLoq9.cjs → unplugin-Drfn-i56.cjs} +3 -2
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.d.cts +4 -4
- package/dist/unplugin.d.ts +4 -4
- package/dist/unplugin.js +3 -3
- package/dist/{vite-C63GJQHT.cjs → vite-D2tETSe2.cjs} +1 -1
- package/dist/vite-DJ6fWtCh.js +7 -0
- package/dist/vite.cjs +4 -4
- package/dist/vite.d.cts +4 -5
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +4 -4
- package/dist/volar.cjs +10 -5
- package/dist/volar.d.cts +1 -1
- package/dist/volar.d.ts +1 -1
- package/dist/webpack-BTWabvH7.js +7 -0
- package/dist/{webpack-CeAur76z.cjs → webpack-Cpgko_pp.cjs} +1 -1
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.d.cts +4 -5
- package/dist/webpack.d.ts +3 -3
- package/dist/webpack.js +4 -4
- package/package.json +4 -5
- package/dist/core-C-41-Q2Y.cjs +0 -33
- package/dist/core-CJgJmh2O.js +0 -27
- package/dist/options.d.cjs +0 -0
- package/dist/options.d.cts +0 -2
- package/dist/options.d.ts +0 -2
- package/dist/raw-B2YMrqwY.cjs +0 -213
- package/dist/raw-CWZ5g7Vk.js +0 -207
- package/dist/vite-Djd6MAt9.js +0 -7
- package/dist/webpack-3fgVTA33.js +0 -7
package/dist/api.cjs
CHANGED
package/dist/api.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
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):
|
|
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-
|
|
2
|
-
import * as
|
|
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):
|
|
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
package/dist/astro.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
require('./core-BeuKLsFR.cjs');
|
|
3
|
+
require('./raw-sUsbkvbl.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-Drfn-i56.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-
|
|
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
|
-
|
|
11
|
-
export { _default as default };
|
|
10
|
+
export = _default;
|
package/dist/astro.d.ts
CHANGED
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CfhBppKN.js";
|
|
2
|
+
import "./raw-D8DIsSla.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Bgf_17my.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-
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
require('./core-BeuKLsFR.cjs');
|
|
3
|
+
require('./raw-sUsbkvbl.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-Drfn-i56.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
var esbuild_default = require_unplugin.unplugin_default.esbuild;
|
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
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) =>
|
|
6
|
-
|
|
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-
|
|
2
|
-
import * as
|
|
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) =>
|
|
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-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CfhBppKN.js";
|
|
2
|
+
import "./raw-D8DIsSla.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Bgf_17my.js";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild.ts
|
|
6
6
|
var esbuild_default = unplugin_default.esbuild;
|
package/dist/index.js
CHANGED
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-
|
|
4
|
-
require('./raw-
|
|
5
|
-
require('./unplugin-
|
|
6
|
-
const require_vite = require('./vite-
|
|
7
|
-
const require_webpack = require('./webpack-
|
|
8
|
-
|
|
3
|
+
require('./core-BeuKLsFR.cjs');
|
|
4
|
+
require('./raw-sUsbkvbl.cjs');
|
|
5
|
+
require('./unplugin-Drfn-i56.cjs');
|
|
6
|
+
const require_vite = require('./vite-D2tETSe2.cjs');
|
|
7
|
+
const require_webpack = require('./webpack-Cpgko_pp.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
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
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:
|
|
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-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import "./unplugin-
|
|
4
|
-
import { vite_default } from "./vite-
|
|
5
|
-
import { webpack_default } from "./webpack-
|
|
1
|
+
import "./core-CfhBppKN.js";
|
|
2
|
+
import "./raw-D8DIsSla.js";
|
|
3
|
+
import "./unplugin-Bgf_17my.js";
|
|
4
|
+
import { t as vite_default } from "./vite-DJ6fWtCh.js";
|
|
5
|
+
import { t as webpack_default } from "./webpack-BTWabvH7.js";
|
|
6
6
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
7
7
|
import "@nuxt/schema";
|
|
8
8
|
|
|
@@ -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
|
+
{
|
|
61
|
+
enforce: "pre",
|
|
62
|
+
name: "vue-jsx-vapor",
|
|
63
|
+
vite: {
|
|
64
|
+
config(config) {
|
|
65
|
+
return { define: {
|
|
66
|
+
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
|
|
67
|
+
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
|
|
68
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
|
|
69
|
+
} };
|
|
70
|
+
},
|
|
71
|
+
configResolved(config) {
|
|
72
|
+
root = config.root;
|
|
73
|
+
needHMR = config.command === "serve";
|
|
74
|
+
needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
resolveId(id) {
|
|
78
|
+
if (id === ssrRegisterHelperId) return id;
|
|
79
|
+
},
|
|
80
|
+
loadInclude(id) {
|
|
81
|
+
if (id === ssrRegisterHelperId) return true;
|
|
82
|
+
},
|
|
83
|
+
load(id) {
|
|
84
|
+
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
85
|
+
},
|
|
86
|
+
transformInclude,
|
|
87
|
+
transform(code, id, opt) {
|
|
88
|
+
const result = transformVueJsxVapor(code, opt?.ssr ? normalizePath(relative(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
|
|
89
|
+
if (result?.code) return {
|
|
90
|
+
code: result.code,
|
|
91
|
+
map: result.map ? JSON.parse(result.map) : null
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "@vue-macros/jsx-directive",
|
|
97
|
+
transformInclude,
|
|
98
|
+
transform(code, id, opt) {
|
|
99
|
+
if (options.interop || opt?.ssr) return transformJsxDirective(code, id, {
|
|
100
|
+
lib: "vue",
|
|
101
|
+
prefix: "v-",
|
|
102
|
+
version: 3.6
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "@vitejs/plugin-vue-jsx",
|
|
108
|
+
transformInclude,
|
|
109
|
+
transform(code, id, opt) {
|
|
110
|
+
if (options.interop || opt?.ssr) return transformVueJsx(code, id, needSourceMap);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
...options.macros === false ? [] : options.macros ? [macros(options.macros === true ? void 0 : options.macros)] : []
|
|
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
|
+
{
|
|
69
|
+
enforce: "pre",
|
|
70
|
+
name: "vue-jsx-vapor",
|
|
71
|
+
vite: {
|
|
72
|
+
config(config) {
|
|
73
|
+
return { define: {
|
|
74
|
+
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
|
|
75
|
+
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
|
|
76
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
|
|
77
|
+
} };
|
|
78
|
+
},
|
|
79
|
+
configResolved(config) {
|
|
80
|
+
root = config.root;
|
|
81
|
+
needHMR = config.command === "serve";
|
|
82
|
+
needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
resolveId(id) {
|
|
86
|
+
if (id === ssrRegisterHelperId) return id;
|
|
87
|
+
},
|
|
88
|
+
loadInclude(id) {
|
|
89
|
+
if (id === ssrRegisterHelperId) return true;
|
|
90
|
+
},
|
|
91
|
+
load(id) {
|
|
92
|
+
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
93
|
+
},
|
|
94
|
+
transformInclude,
|
|
95
|
+
transform(code, id, opt) {
|
|
96
|
+
const result = require_core.transformVueJsxVapor(code, opt?.ssr ? (0, unplugin_utils.normalizePath)((0, pathe.relative)(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
|
|
97
|
+
if (result?.code) return {
|
|
98
|
+
code: result.code,
|
|
99
|
+
map: result.map ? JSON.parse(result.map) : null
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "@vue-macros/jsx-directive",
|
|
105
|
+
transformInclude,
|
|
106
|
+
transform(code, id, opt) {
|
|
107
|
+
if (options.interop || opt?.ssr) return (0, __vue_macros_jsx_directive_api.transformJsxDirective)(code, id, {
|
|
108
|
+
lib: "vue",
|
|
109
|
+
prefix: "v-",
|
|
110
|
+
version: 3.6
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "@vitejs/plugin-vue-jsx",
|
|
116
|
+
transformInclude,
|
|
117
|
+
transform(code, id, opt) {
|
|
118
|
+
if (options.interop || opt?.ssr) return transformVueJsx(code, id, needSourceMap);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
...options.macros === false ? [] : options.macros ? [(0, __vue_jsx_vapor_macros_raw.default)(options.macros === true ? void 0 : options.macros)] : []
|
|
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-
|
|
3
|
-
const require_raw = require('./raw-
|
|
2
|
+
require('./core-BeuKLsFR.cjs');
|
|
3
|
+
const require_raw = require('./raw-sUsbkvbl.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-
|
|
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
|
-
|
|
7
|
-
export { plugin as default };
|
|
6
|
+
export = plugin;
|
package/dist/raw.d.ts
CHANGED
package/dist/raw.js
CHANGED
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-
|
|
4
|
-
require('./raw-
|
|
5
|
-
const require_unplugin = require('./unplugin-
|
|
6
|
-
|
|
3
|
+
require('./core-BeuKLsFR.cjs');
|
|
4
|
+
require('./raw-sUsbkvbl.cjs');
|
|
5
|
+
const require_unplugin = require('./unplugin-Drfn-i56.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);
|
package/dist/rolldown.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
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) =>
|
|
6
|
-
|
|
7
|
-
export { _default as default };
|
|
5
|
+
declare const _default: (options?: Options | undefined) => unplugin0.RollupPlugin<any> | unplugin0.RollupPlugin<any>[];
|
|
6
|
+
export = _default;
|
package/dist/rolldown.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
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) =>
|
|
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-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unpluginFactory } from "./unplugin-
|
|
1
|
+
import "./core-CfhBppKN.js";
|
|
2
|
+
import "./raw-D8DIsSla.js";
|
|
3
|
+
import { n as unpluginFactory } from "./unplugin-Bgf_17my.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-
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
require('./core-BeuKLsFR.cjs');
|
|
3
|
+
require('./raw-sUsbkvbl.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-Drfn-i56.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-
|
|
2
|
-
import * as
|
|
1
|
+
import { t as Options } from "./options-DxHQU8-_.cjs";
|
|
2
|
+
import * as unplugin0 from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
6
|
-
|
|
7
|
-
export { _default as default };
|
|
5
|
+
declare const _default: (options?: Options | undefined) => unplugin0.RollupPlugin<any>[];
|
|
6
|
+
export = _default;
|
package/dist/rollup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
2
|
-
import * as
|
|
1
|
+
import { t as Options } from "./options-D6zn5V49.js";
|
|
2
|
+
import * as unplugin2 from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => unplugin2.RollupPlugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rollup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CfhBppKN.js";
|
|
2
|
+
import "./raw-D8DIsSla.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Bgf_17my.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-
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
require('./core-BeuKLsFR.cjs');
|
|
3
|
+
require('./raw-sUsbkvbl.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-Drfn-i56.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
var rspack_default = require_unplugin.unplugin_default.rspack;
|