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.
- package/README.md +2 -2
- package/dist/api.cjs +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +1 -1
- package/dist/astro.cjs +3 -3
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +3 -3
- package/dist/{chunk-CUT6urMc.cjs → chunk-CbDLau6x.cjs} +10 -6
- package/dist/{core-BeuKLsFR.cjs → core-BeIGPz2Y.cjs} +3 -4
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +3 -3
- package/dist/nuxt.cjs +10 -11
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +5 -5
- package/dist/raw-CzYfWnnD.cjs +96 -0
- package/dist/raw-rSj_OSHs.js +89 -0
- package/dist/raw.cjs +2 -2
- package/dist/raw.d.cts +1 -1
- package/dist/raw.d.ts +1 -1
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +4 -5
- package/dist/rolldown.d.cts +1 -1
- package/dist/rolldown.d.ts +1 -1
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +3 -3
- package/dist/{unplugin-BPAlTDcQ.js → unplugin-Cphty0W0.js} +1 -1
- package/dist/{unplugin-6bs2zQro.cjs → unplugin-CrWWgg9F.cjs} +2 -3
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.d.cts +1 -1
- package/dist/unplugin.d.ts +1 -1
- package/dist/unplugin.js +3 -3
- package/dist/vite.cjs +8 -5
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +7 -4
- package/dist/volar.cjs +12 -14
- package/dist/volar.d.cts +1 -1
- package/dist/volar.d.ts +1 -1
- package/dist/webpack.cjs +8 -5
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +7 -4
- package/jsx-runtime/index.cjs +1 -1
- package/package.json +26 -33
- package/dist/raw-B3KlYN7X.js +0 -119
- package/dist/raw-DG3OYbEe.cjs +0 -132
- package/dist/vite-D8MCYNCu.cjs +0 -12
- package/dist/vite-EGcRF3B5.js +0 -7
- package/dist/webpack-CAtjl4UN.cjs +0 -12
- package/dist/webpack-DdK9_Sb1.js +0 -7
- /package/dist/{core-CfhBppKN.js → core-CgC9S6Q0.js} +0 -0
- /package/dist/{options-DxHQU8-_.d.cts → options-V1045xYK.d.cts} +0 -0
- /package/dist/{options-D6zn5V49.d.ts → options-gD_zG4x2.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@ Vapor Mode of Vue JSX.
|
|
|
9
9
|
- ⚡️ High Performance: It has the same performance as Vue Vapor!
|
|
10
10
|
- ⚒️ Directives: Support all build-in directives of Vue.
|
|
11
11
|
- ✨ Macros: Support most macros of Vue, Friendly to JSX.
|
|
12
|
-
- 🦀 Compiler rewritten in Rust:
|
|
12
|
+
- 🦀 Compiler rewritten in Rust: Support generating Virtual DOM and Vapor, Powered by Oxc, 20x performance improvement over Babel plugin.
|
|
13
13
|
- 🦾 Type Safe: Provide Volar plugin support by install TS Macro (VSCode plugin).
|
|
14
|
-
- ⚙️ ESLint: Provide an ESLint plugin for vue-jsx-vapor to automatically format
|
|
14
|
+
- ⚙️ ESLint: Provide an ESLint plugin for vue-jsx-vapor to automatically format directives and macros.
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
package/dist/api.cjs
CHANGED
package/dist/api.d.cts
CHANGED
package/dist/api.d.ts
CHANGED
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-BeIGPz2Y.cjs');
|
|
3
|
+
require('./raw-CzYfWnnD.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/astro.ts
|
|
7
7
|
var astro_default = (options) => ({
|
package/dist/astro.d.cts
CHANGED
package/dist/astro.d.ts
CHANGED
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { r as unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Cphty0W0.js";
|
|
4
4
|
|
|
5
5
|
//#region src/astro.ts
|
|
6
6
|
var astro_default = (options) => ({
|
|
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
return to;
|
|
17
21
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
let
|
|
3
|
-
__vue_jsx_vapor_compiler_rs = require_chunk.__toESM(__vue_jsx_vapor_compiler_rs);
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
let _vue_jsx_vapor_compiler_rs = require("@vue-jsx-vapor/compiler-rs");
|
|
4
3
|
|
|
5
4
|
//#region src/core/index.ts
|
|
6
5
|
function transformVueJsxVapor(code, id, options, needSourceMap = false, needHMR = false, ssr = false) {
|
|
7
|
-
return (0,
|
|
6
|
+
return (0, _vue_jsx_vapor_compiler_rs.transform)(code, {
|
|
8
7
|
filename: id,
|
|
9
8
|
sourceMap: needSourceMap,
|
|
10
9
|
interop: new URLSearchParams(id).get("vapor") ? false : options?.interop,
|
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-BeIGPz2Y.cjs');
|
|
3
|
+
require('./raw-CzYfWnnD.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.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
package/dist/esbuild.d.ts
CHANGED
package/dist/esbuild.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { r as unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Cphty0W0.js";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild.ts
|
|
6
6
|
var esbuild_default = unplugin_default.esbuild;
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
Object.keys(
|
|
3
|
+
var _vue_jsx_vapor_runtime = require("@vue-jsx-vapor/runtime");
|
|
4
|
+
Object.keys(_vue_jsx_vapor_runtime).forEach(function (k) {
|
|
5
5
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: function () { return
|
|
7
|
+
get: function () { return _vue_jsx_vapor_runtime[k]; }
|
|
8
8
|
});
|
|
9
9
|
});
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
5
|
-
require('./unplugin-
|
|
6
|
-
const require_vite = require('./vite
|
|
7
|
-
const require_webpack = require('./webpack
|
|
8
|
-
let
|
|
9
|
-
__nuxt_kit = require_chunk.__toESM(__nuxt_kit);
|
|
2
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
3
|
+
require('./core-BeIGPz2Y.cjs');
|
|
4
|
+
require('./raw-CzYfWnnD.cjs');
|
|
5
|
+
require('./unplugin-CrWWgg9F.cjs');
|
|
6
|
+
const require_vite = require('./vite.cjs');
|
|
7
|
+
const require_webpack = require('./webpack.cjs');
|
|
8
|
+
let _nuxt_kit = require("@nuxt/kit");
|
|
10
9
|
require("@nuxt/schema");
|
|
11
10
|
|
|
12
11
|
//#region src/nuxt.ts
|
|
13
|
-
var nuxt_default = (0,
|
|
12
|
+
var nuxt_default = (0, _nuxt_kit.defineNuxtModule)({
|
|
14
13
|
meta: {
|
|
15
14
|
name: "nuxt-vue-jsx-vapor",
|
|
16
15
|
configKey: "jsxVapor"
|
|
17
16
|
},
|
|
18
17
|
setup(options) {
|
|
19
|
-
(0,
|
|
20
|
-
(0,
|
|
18
|
+
(0, _nuxt_kit.addVitePlugin)(() => require_vite.default(options));
|
|
19
|
+
(0, _nuxt_kit.addWebpackPlugin)(() => require_webpack.default(options));
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
22
|
|
package/dist/nuxt.d.cts
CHANGED
package/dist/nuxt.d.ts
CHANGED
package/dist/nuxt.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import "./unplugin-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import "./unplugin-Cphty0W0.js";
|
|
4
|
+
import vite_default from "./vite.js";
|
|
5
|
+
import webpack_default from "./webpack.js";
|
|
6
6
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
7
7
|
import "@nuxt/schema";
|
|
8
8
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
const require_core = require('./core-BeIGPz2Y.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 pathe = require("pathe");
|
|
6
|
+
let unplugin_utils = require("unplugin-utils");
|
|
7
|
+
|
|
8
|
+
//#region src/core/ssr.ts
|
|
9
|
+
const ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
|
|
10
|
+
const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\nexport const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
|
|
11
|
+
/**
|
|
12
|
+
* This function is serialized with toString() and evaluated as a virtual
|
|
13
|
+
* module during SSR
|
|
14
|
+
*/
|
|
15
|
+
function ssrRegisterHelper(comp, filename) {
|
|
16
|
+
if (typeof comp === "function") comp.__setup = () => {
|
|
17
|
+
const ssrContext = useSSRContext();
|
|
18
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
|
|
19
|
+
};
|
|
20
|
+
else {
|
|
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) return setup(props, ctx);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/runtime/props.ts?raw
|
|
32
|
+
var props_default = "import { proxyRefs, toRefs, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\nexport function useProps() {\n const i = getCurrentInstance();\n return i.props;\n}\nexport function useFullProps() {\n return proxyRefs({\n ...toRefs(useProps()),\n ...toRefs(useAttrs())\n });\n}\n";
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/runtime/vnode.ts?raw
|
|
36
|
+
var vnode_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache() {\n const i = getCurrentInstance();\n if (i) {\n !cacheMap.has(i) && cacheMap.set(i, []);\n const caches = cacheMap.get(i);\n return caches[caches.length] = [];\n } else {\n return [];\n }\n}\nexport function normalizeVNode(child = \" \", flag = 0) {\n if (child == null || typeof child === \"boolean\") {\n return createVNode(Comment);\n } else if (Array.isArray(child)) {\n return openBlock(), createBlock(createVNode(Fragment, null, child.slice()));\n } else if (isVNode(child)) {\n return openBlock(), createBlock(cloneIfMounted(child));\n } else {\n return createVNode(Text, null, String(child), flag);\n }\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\n";
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/runtime/raw.ts
|
|
40
|
+
const vnodeHelperId = "/vue-jsx-vapor/vnode";
|
|
41
|
+
const propsHelperId = "/vue-jsx-vapor/props";
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/raw.ts
|
|
45
|
+
const plugin = (options = {}) => {
|
|
46
|
+
const transformInclude = (0, unplugin_utils.createFilter)(options?.include || /\.[cm]?[jt]sx$/, options?.exclude || /node_modules/);
|
|
47
|
+
let root = "";
|
|
48
|
+
let needHMR = false;
|
|
49
|
+
let needSourceMap = options.sourceMap || false;
|
|
50
|
+
return [...options.macros === false ? [] : options.macros ? [(0, _vue_jsx_vapor_macros_raw.default)(options.macros === true ? void 0 : options.macros)] : [], {
|
|
51
|
+
enforce: "pre",
|
|
52
|
+
name: "vue-jsx-vapor",
|
|
53
|
+
vite: {
|
|
54
|
+
config(config) {
|
|
55
|
+
return { define: {
|
|
56
|
+
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
|
|
57
|
+
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
|
|
58
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
|
|
59
|
+
} };
|
|
60
|
+
},
|
|
61
|
+
configResolved(config) {
|
|
62
|
+
root = config.root;
|
|
63
|
+
needHMR = config.command === "serve";
|
|
64
|
+
needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
resolveId(id) {
|
|
68
|
+
if (id === ssrRegisterHelperId || id === vnodeHelperId || id === propsHelperId) return id;
|
|
69
|
+
},
|
|
70
|
+
loadInclude(id) {
|
|
71
|
+
if (id === ssrRegisterHelperId || id === vnodeHelperId || id === propsHelperId) return true;
|
|
72
|
+
},
|
|
73
|
+
load(id) {
|
|
74
|
+
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
75
|
+
if (id === vnodeHelperId) return vnode_default;
|
|
76
|
+
if (id === propsHelperId) return props_default;
|
|
77
|
+
},
|
|
78
|
+
transformInclude,
|
|
79
|
+
transform(code, id, opt) {
|
|
80
|
+
const result = require_core.transformVueJsxVapor(code, opt?.ssr ? (0, unplugin_utils.normalizePath)((0, pathe.relative)(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
|
|
81
|
+
if (result?.code) return {
|
|
82
|
+
code: result.code,
|
|
83
|
+
map: result.map ? JSON.parse(result.map) : null
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}];
|
|
87
|
+
};
|
|
88
|
+
var raw_default = plugin;
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
Object.defineProperty(exports, 'raw_default', {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function () {
|
|
94
|
+
return raw_default;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as transformVueJsxVapor } from "./core-CgC9S6Q0.js";
|
|
2
|
+
import macros from "@vue-jsx-vapor/macros/raw";
|
|
3
|
+
import { relative } from "pathe";
|
|
4
|
+
import { createFilter, normalizePath } from "unplugin-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/core/ssr.ts
|
|
7
|
+
const ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
|
|
8
|
+
const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\nexport const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
|
|
9
|
+
/**
|
|
10
|
+
* This function is serialized with toString() and evaluated as a virtual
|
|
11
|
+
* module during SSR
|
|
12
|
+
*/
|
|
13
|
+
function ssrRegisterHelper(comp, filename) {
|
|
14
|
+
if (typeof comp === "function") comp.__setup = () => {
|
|
15
|
+
const ssrContext = useSSRContext();
|
|
16
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
|
|
17
|
+
};
|
|
18
|
+
else {
|
|
19
|
+
const setup = comp.setup;
|
|
20
|
+
comp.setup = (props, ctx) => {
|
|
21
|
+
const ssrContext = useSSRContext();
|
|
22
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
|
|
23
|
+
if (setup) return setup(props, ctx);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/runtime/props.ts?raw
|
|
30
|
+
var props_default = "import { proxyRefs, toRefs, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\nexport function useProps() {\n const i = getCurrentInstance();\n return i.props;\n}\nexport function useFullProps() {\n return proxyRefs({\n ...toRefs(useProps()),\n ...toRefs(useAttrs())\n });\n}\n";
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/runtime/vnode.ts?raw
|
|
34
|
+
var vnode_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache() {\n const i = getCurrentInstance();\n if (i) {\n !cacheMap.has(i) && cacheMap.set(i, []);\n const caches = cacheMap.get(i);\n return caches[caches.length] = [];\n } else {\n return [];\n }\n}\nexport function normalizeVNode(child = \" \", flag = 0) {\n if (child == null || typeof child === \"boolean\") {\n return createVNode(Comment);\n } else if (Array.isArray(child)) {\n return openBlock(), createBlock(createVNode(Fragment, null, child.slice()));\n } else if (isVNode(child)) {\n return openBlock(), createBlock(cloneIfMounted(child));\n } else {\n return createVNode(Text, null, String(child), flag);\n }\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\n";
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/runtime/raw.ts
|
|
38
|
+
const vnodeHelperId = "/vue-jsx-vapor/vnode";
|
|
39
|
+
const propsHelperId = "/vue-jsx-vapor/props";
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/raw.ts
|
|
43
|
+
const plugin = (options = {}) => {
|
|
44
|
+
const transformInclude = createFilter(options?.include || /\.[cm]?[jt]sx$/, options?.exclude || /node_modules/);
|
|
45
|
+
let root = "";
|
|
46
|
+
let needHMR = false;
|
|
47
|
+
let needSourceMap = options.sourceMap || false;
|
|
48
|
+
return [...options.macros === false ? [] : options.macros ? [macros(options.macros === true ? void 0 : options.macros)] : [], {
|
|
49
|
+
enforce: "pre",
|
|
50
|
+
name: "vue-jsx-vapor",
|
|
51
|
+
vite: {
|
|
52
|
+
config(config) {
|
|
53
|
+
return { define: {
|
|
54
|
+
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
|
|
55
|
+
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
|
|
56
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
|
|
57
|
+
} };
|
|
58
|
+
},
|
|
59
|
+
configResolved(config) {
|
|
60
|
+
root = config.root;
|
|
61
|
+
needHMR = config.command === "serve";
|
|
62
|
+
needSourceMap ||= config.command === "serve" || !!config.build.sourcemap;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
resolveId(id) {
|
|
66
|
+
if (id === ssrRegisterHelperId || id === vnodeHelperId || id === propsHelperId) return id;
|
|
67
|
+
},
|
|
68
|
+
loadInclude(id) {
|
|
69
|
+
if (id === ssrRegisterHelperId || id === vnodeHelperId || id === propsHelperId) return true;
|
|
70
|
+
},
|
|
71
|
+
load(id) {
|
|
72
|
+
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
73
|
+
if (id === vnodeHelperId) return vnode_default;
|
|
74
|
+
if (id === propsHelperId) return props_default;
|
|
75
|
+
},
|
|
76
|
+
transformInclude,
|
|
77
|
+
transform(code, id, opt) {
|
|
78
|
+
const result = transformVueJsxVapor(code, opt?.ssr ? normalizePath(relative(root, id)) : id, options, needSourceMap, needHMR, opt?.ssr);
|
|
79
|
+
if (result?.code) return {
|
|
80
|
+
code: result.code,
|
|
81
|
+
map: result.map ? JSON.parse(result.map) : null
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}];
|
|
85
|
+
};
|
|
86
|
+
var raw_default = plugin;
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { raw_default as t };
|
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-BeIGPz2Y.cjs');
|
|
3
|
+
const require_raw = require('./raw-CzYfWnnD.cjs');
|
|
4
4
|
|
|
5
5
|
exports.default = require_raw.raw_default;
|
package/dist/raw.d.cts
CHANGED
package/dist/raw.d.ts
CHANGED
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
5
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
3
|
+
require('./core-BeIGPz2Y.cjs');
|
|
4
|
+
require('./raw-CzYfWnnD.cjs');
|
|
5
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
|
|
6
6
|
let unplugin = require("unplugin");
|
|
7
|
-
unplugin = require_chunk.__toESM(unplugin);
|
|
8
7
|
|
|
9
8
|
//#region src/rolldown.ts
|
|
10
9
|
var rolldown_default = (0, unplugin.createRollupPlugin)(require_unplugin.unpluginFactory);
|
package/dist/rolldown.d.cts
CHANGED
package/dist/rolldown.d.ts
CHANGED
package/dist/rolldown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { n as unpluginFactory } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { n as unpluginFactory } from "./unplugin-Cphty0W0.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-BeIGPz2Y.cjs');
|
|
3
|
+
require('./raw-CzYfWnnD.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.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
package/dist/rollup.d.ts
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { r as unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Cphty0W0.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-BeIGPz2Y.cjs');
|
|
3
|
+
require('./raw-CzYfWnnD.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
var rspack_default = require_unplugin.unplugin_default.rspack;
|
package/dist/rspack.d.cts
CHANGED
package/dist/rspack.d.ts
CHANGED
package/dist/rspack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { r as unplugin_default } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { r as unplugin_default } from "./unplugin-Cphty0W0.js";
|
|
4
4
|
|
|
5
5
|
//#region src/rspack.ts
|
|
6
6
|
var rspack_default = unplugin_default.rspack;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
const require_raw = require('./raw-
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
const require_raw = require('./raw-CzYfWnnD.cjs');
|
|
3
3
|
let unplugin = require("unplugin");
|
|
4
|
-
unplugin = require_chunk.__toESM(unplugin);
|
|
5
4
|
|
|
6
5
|
//#region src/unplugin.ts
|
|
7
6
|
const unpluginFactory = (options = {}) => {
|
package/dist/unplugin.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-BeIGPz2Y.cjs');
|
|
3
|
+
require('./raw-CzYfWnnD.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-CrWWgg9F.cjs');
|
|
5
5
|
|
|
6
6
|
exports.default = require_unplugin.unplugin_default;
|
|
7
7
|
exports.unplugin = require_unplugin.unplugin;
|
package/dist/unplugin.d.cts
CHANGED
package/dist/unplugin.d.ts
CHANGED
package/dist/unplugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { n as unpluginFactory, r as unplugin_default, t as unplugin } from "./unplugin-
|
|
1
|
+
import "./core-CgC9S6Q0.js";
|
|
2
|
+
import "./raw-rSj_OSHs.js";
|
|
3
|
+
import { n as unpluginFactory, r as unplugin_default, t as unplugin } from "./unplugin-Cphty0W0.js";
|
|
4
4
|
|
|
5
5
|
export { unplugin_default as default, unplugin, unpluginFactory };
|