Skip to content

Commit

Permalink
feat: sync to @vitejs/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jul 23, 2024
1 parent 53af576 commit d7f4fa7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Transform Vue 3 SFC to JavaScript.

## Thanks

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).
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).

## Sponsors

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@sxzz/prettier-config": "^2.0.2",
"@types/debug": "^4.1.12",
"@types/node": "^20.14.11",
"@vitejs/plugin-vue": "5.0.5",
"@vitejs/plugin-vue": "5.1.0",
"@vitest/ui": "2.0.4",
"bumpp": "^9.4.1",
"esbuild": "0.23.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/__snapshots__/esbuild.test.ts.snap
Binary file not shown.
69 changes: 41 additions & 28 deletions tests/__snapshots__/rollup.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ var _export_sfc = (sfc, props) => {
const _sfc_main = {
__name: 'reactivity-transform',
setup(__props) {
setup(__props, { expose: __expose }) {
__expose();
const ref1 = $ref('hello');
const ref2 = $(ref('hello'));
Expand All @@ -110,7 +111,9 @@ console.log(ref2);
console.log($$(ref1));
console.log($$(ref2));
return () => {}
const __returned__ = { ref1, ref2, ref };
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
return __returned__
}
};
Expand Down Expand Up @@ -157,23 +160,30 @@ var _export_sfc = (sfc, props) => {
return target;
};
const _hoisted_1 = /*#__PURE__*/createElementVNode("h1", null, "Hello World", -1 /* HOISTED */);
const _hoisted_2 = [
_hoisted_1
];
const foo = 'bar';
const _sfc_main = {
__name: 'script-setup',
setup(__props) {
setup(__props, { expose: __expose }) {
__expose();
return (_ctx, _cache) => {
return (openBlock(), createElementBlock("div", null, _hoisted_2))
}
const __returned__ = { foo };
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
return __returned__
}
};
var scriptSetup = /*#__PURE__*/_export_sfc(_sfc_main, [['__file','#FILE#']]);
const _hoisted_1 = /*#__PURE__*/createElementVNode("h1", null, "Hello World", -1 /* HOISTED */);
const _hoisted_2 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createElementBlock("div", null, [..._hoisted_2]))
}
var scriptSetup = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__file','#FILE#']]);
export { scriptSetup as default };
"
Expand Down Expand Up @@ -208,31 +218,21 @@ exports[`transform > fixtures > tests/fixtures/script-setup-ts.vue > isProductio
"//script-setup-ts.js
import { defineComponent, openBlock, createElementBlock, createElementVNode } from 'vue';
const _hoisted_1 = /* @__PURE__ */ createElementVNode(
"h1",
null,
"Hello World",
-1
/* HOISTED */
);
const _hoisted_2 = [
_hoisted_1
];
const str = "bar";
var script_setup_ts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
__name: "script-setup-ts",
props: {
foo: {},
bar: {},
baz: { type: Boolean }
foo: { type: String, required: true },
bar: { type: Number, required: true },
baz: { type: Boolean, required: true }
},
setup(__props, { expose: __expose }) {
__expose({
str
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, _hoisted_2);
};
const __returned__ = { str };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
});
Expand All @@ -244,7 +244,20 @@ var _export_sfc = (sfc, props) => {
return target;
};
var scriptSetupTs = /* @__PURE__ */ _export_sfc(script_setup_ts_vue_vue_type_script_setup_true_lang_default, [["__file", '#FILE#']]);
const _hoisted_1 = /* @__PURE__ */ createElementVNode(
"h1",
null,
"Hello World",
-1
/* HOISTED */
);
const _hoisted_2 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, [..._hoisted_2]);
}
var scriptSetupTs = /* @__PURE__ */ _export_sfc(script_setup_ts_vue_vue_type_script_setup_true_lang_default, [["render", _sfc_render], ["__file", '#FILE#']]);
export { scriptSetupTs as default };
"
Expand Down

0 comments on commit d7f4fa7

Please sign in to comment.