Skip to content

Commit d7f4fa7

Browse files
committed
feat: sync to @vitejs/plugin-vue@5.1.0
1 parent 53af576 commit d7f4fa7

File tree

5 files changed

+48
-35
lines changed

5 files changed

+48
-35
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Transform Vue 3 SFC to JavaScript.
3535

3636
## Thanks
3737

38-
Thanks to [vite-plugin-vue](https://github.com/vitejs/vite-plugin-vue). This project is inherited from [@vitejs/plugin-vue@5.0.2](https://github.com/vitejs/vite-plugin-vue/tree/plugin-vue@5.0.2/packages/plugin-vue).
38+
Thanks to [vite-plugin-vue](https://github.com/vitejs/vite-plugin-vue). This project is inherited from [@vitejs/plugin-vue@5.1.0](https://github.com/vitejs/vite-plugin-vue/tree/plugin-vue@5.1.0/packages/plugin-vue).
3939

4040
## Sponsors
4141

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"@sxzz/prettier-config": "^2.0.2",
9292
"@types/debug": "^4.1.12",
9393
"@types/node": "^20.14.11",
94-
"@vitejs/plugin-vue": "5.0.5",
94+
"@vitejs/plugin-vue": "5.1.0",
9595
"@vitest/ui": "2.0.4",
9696
"bumpp": "^9.4.1",
9797
"esbuild": "0.23.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
740 Bytes
Binary file not shown.

tests/__snapshots__/rollup.test.ts.snap

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ var _export_sfc = (sfc, props) => {
100100
101101
const _sfc_main = {
102102
__name: 'reactivity-transform',
103-
setup(__props) {
103+
setup(__props, { expose: __expose }) {
104+
__expose();
104105
105106
const ref1 = $ref('hello');
106107
const ref2 = $(ref('hello'));
@@ -110,7 +111,9 @@ console.log(ref2);
110111
console.log($$(ref1));
111112
console.log($$(ref2));
112113
113-
return () => {}
114+
const __returned__ = { ref1, ref2, ref };
115+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
116+
return __returned__
114117
}
115118
116119
};
@@ -157,23 +160,30 @@ var _export_sfc = (sfc, props) => {
157160
return target;
158161
};
159162
160-
const _hoisted_1 = /*#__PURE__*/createElementVNode("h1", null, "Hello World", -1 /* HOISTED */);
161-
const _hoisted_2 = [
162-
_hoisted_1
163-
];
163+
const foo = 'bar';
164164
165165
const _sfc_main = {
166166
__name: 'script-setup',
167-
setup(__props) {
167+
setup(__props, { expose: __expose }) {
168+
__expose();
168169
169170
170-
return (_ctx, _cache) => {
171-
return (openBlock(), createElementBlock("div", null, _hoisted_2))
172-
}
171+
const __returned__ = { foo };
172+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
173+
return __returned__
173174
}
174175
175176
};
176-
var scriptSetup = /*#__PURE__*/_export_sfc(_sfc_main, [['__file','#FILE#']]);
177+
178+
const _hoisted_1 = /*#__PURE__*/createElementVNode("h1", null, "Hello World", -1 /* HOISTED */);
179+
const _hoisted_2 = [
180+
_hoisted_1
181+
];
182+
183+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
184+
return (openBlock(), createElementBlock("div", null, [..._hoisted_2]))
185+
}
186+
var scriptSetup = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__file','#FILE#']]);
177187
178188
export { scriptSetup as default };
179189
"
@@ -208,31 +218,21 @@ exports[`transform > fixtures > tests/fixtures/script-setup-ts.vue > isProductio
208218
"//script-setup-ts.js
209219
import { defineComponent, openBlock, createElementBlock, createElementVNode } from 'vue';
210220
211-
const _hoisted_1 = /* @__PURE__ */ createElementVNode(
212-
"h1",
213-
null,
214-
"Hello World",
215-
-1
216-
/* HOISTED */
217-
);
218-
const _hoisted_2 = [
219-
_hoisted_1
220-
];
221221
const str = "bar";
222222
var script_setup_ts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
223223
__name: "script-setup-ts",
224224
props: {
225-
foo: {},
226-
bar: {},
227-
baz: { type: Boolean }
225+
foo: { type: String, required: true },
226+
bar: { type: Number, required: true },
227+
baz: { type: Boolean, required: true }
228228
},
229229
setup(__props, { expose: __expose }) {
230230
__expose({
231231
str
232232
});
233-
return (_ctx, _cache) => {
234-
return openBlock(), createElementBlock("div", null, _hoisted_2);
235-
};
233+
const __returned__ = { str };
234+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
235+
return __returned__;
236236
}
237237
});
238238
@@ -244,7 +244,20 @@ var _export_sfc = (sfc, props) => {
244244
return target;
245245
};
246246
247-
var scriptSetupTs = /* @__PURE__ */ _export_sfc(script_setup_ts_vue_vue_type_script_setup_true_lang_default, [["__file", '#FILE#']]);
247+
const _hoisted_1 = /* @__PURE__ */ createElementVNode(
248+
"h1",
249+
null,
250+
"Hello World",
251+
-1
252+
/* HOISTED */
253+
);
254+
const _hoisted_2 = [
255+
_hoisted_1
256+
];
257+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
258+
return openBlock(), createElementBlock("div", null, [..._hoisted_2]);
259+
}
260+
var scriptSetupTs = /* @__PURE__ */ _export_sfc(script_setup_ts_vue_vue_type_script_setup_true_lang_default, [["render", _sfc_render], ["__file", '#FILE#']]);
248261
249262
export { scriptSetupTs as default };
250263
"

0 commit comments

Comments
 (0)