Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/vue-component-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@rslib/core": "workspace:*",
"rsbuild-plugin-unplugin-vue": "^0.1.0",
"rsbuild-plugin-unplugin-vue": "^0.2.0",
"typescript": "^5.9.3",
"vue": "^3.5.30",
"vue-tsc": "^3.2.5"
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-component-bundleless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@storybook/addon-docs": "^10.2.19",
"@storybook/addon-onboarding": "^10.2.19",
"@storybook/vue3": "^10.2.19",
"rsbuild-plugin-unplugin-vue": "^0.1.0",
"rsbuild-plugin-unplugin-vue": "^0.2.0",
"storybook": "^10.2.19",
"storybook-addon-rslib": "^3.3.2",
"storybook-vue3-rsbuild": "^3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "pnpm --filter \"./packages/*\" run build",
"build:examples": "pnpm --filter \"@examples/*\" --filter \"!@examples/vue-component-*\" run build",
"build:examples": "pnpm --filter \"@examples/*\" run build",
"change": "changeset",
"changeset": "changeset",
"check-dependency-version": "check-dependency-version-consistency . && echo",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-rslib/template-vue-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@rslib/core": "workspace:*",
"rsbuild-plugin-unplugin-vue": "^0.1.0",
"rsbuild-plugin-unplugin-vue": "^0.2.0",
"vue": "^3.5.30"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-rslib/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@rslib/core": "workspace:*",
"rsbuild-plugin-unplugin-vue": "^0.1.0",
"rsbuild-plugin-unplugin-vue": "^0.2.0",
"typescript": "^5.9.3",
"vue": "^3.5.30",
"vue-tsc": "^3.2.5"
Expand Down
779 changes: 443 additions & 336 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

29 changes: 13 additions & 16 deletions tests/integration/vue/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { beforeAll, describe, expect, test } from '@rstest/core';
import { buildAndGetResults, type BuildResult } from 'test-helper';

// '__file' path can't be normalized on win32.
describe.runIf(platform() !== 'win32').skip('ESM', async () => {
describe.runIf(platform() !== 'win32')('ESM', async () => {
let jsResult: BuildResult;
let cssResult: BuildResult;

Expand Down Expand Up @@ -140,13 +140,16 @@ describe.runIf(platform() !== 'win32').skip('ESM', async () => {
test('bundleless', async () => {
expect(jsResult.contents.esm0).toMatchInlineSnapshot(`
{
"<ROOT>/tests/integration/vue/dist/bundleless/Button/Button.js": "import "./style.css";
import { createElementBlock, openBlock, ref, toDisplayString } from "vue";
const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{
"<ROOT>/tests/integration/vue/dist/bundleless/544.js": "const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props)target[key] = val;
return target;
};
export { _00_2Fplugin_vue_2Fexport_helper };
",
"<ROOT>/tests/integration/vue/dist/bundleless/Button/Button.js": "import "./style.css";
import { createElementBlock, openBlock, ref, toDisplayString } from "vue";
import { _00_2Fplugin_vue_2Fexport_helper } from "../544.js";
const _sfc_main = {
__name: 'Button',
setup (__props, { expose: __expose }) {
Expand Down Expand Up @@ -179,17 +182,12 @@ describe.runIf(platform() !== 'win32').skip('ESM', async () => {
"<ROOT>/tests/integration/vue/src/Button/Button.vue"
]
]);
export { Button as default };
export default Button;
",
"<ROOT>/tests/integration/vue/dist/bundleless/Button/index.js": "import Button from "./Button.js";
export { Button as default };
"<ROOT>/tests/integration/vue/dist/bundleless/Button/index.js": "export { default } from "./Button.js";
",
"<ROOT>/tests/integration/vue/dist/bundleless/Card.js": "import { createElementBlock, openBlock, ref, toDisplayString } from "vue";
const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props)target[key] = val;
return target;
};
import { _00_2Fplugin_vue_2Fexport_helper } from "./544.js";
const _sfc_main = {
__name: 'Card',
setup (__props, { expose: __expose }) {
Expand Down Expand Up @@ -222,11 +220,10 @@ describe.runIf(platform() !== 'win32').skip('ESM', async () => {
"<ROOT>/tests/integration/vue/src/Card.vue"
]
]);
export { Card as default };
export default Card;
",
"<ROOT>/tests/integration/vue/dist/bundleless/index.js": "import Button from "./Button/index.js";
import Card from "./Card.js";
export { Button, Card };
"<ROOT>/tests/integration/vue/dist/bundleless/index.js": "export { default as Button } from "./Button/index.js";
export { default as Card } from "./Card.js";
",
}
`);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"devDependencies": {
"@rsbuild/plugin-less": "^1.6.2",
"rsbuild-plugin-unplugin-vue": "^0.1.0",
"rsbuild-plugin-unplugin-vue": "^0.2.0",
"vue": "^3.5.30"
},
"peerDependencies": {
Expand Down
Loading