-
-
Notifications
You must be signed in to change notification settings - Fork 179
Open
Labels
Description
Describe the bug
When building a Vue library with npm run build, a single button.vue component generates two files with the same base name, resulting in button.js and button2.js. The button2.js file contains only a simple re-export that imports from button.js, expect only generate button.js
Reproduction
https://stackblitz.com/edit/vitejs-vite-g1wlnnnn?file=dist%2Fes%2Fbutton%2Fbutton2.js
Steps to reproduce
- Run pnpm run build
- Check the output in dist/es/button/ directory
- Observe that both button.js and button2.js are generated
System Info
System:
OS: macOS 14.1
CPU: (10) arm64 Apple M2 Pro
Memory: 85.28 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.17.1 - ~/.nvm/versions/node/v22.17.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.10.0/bin/yarn
npm: 10.9.2 - ~/.nvm/versions/node/v22.17.1/bin/npm
pnpm: 10.13.1 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
bun: 1.1.8 - ~/.bun/bin/bun
Browsers:
Chrome: 138.0.7204.158
Safari: 17.1
npmPackages:
@vitejs/plugin-vue: ^6.0.0 => 6.0.0
@vitejs/plugin-vue-jsx: ^5.0.1 => 5.0.1
vite: ^7.0.4 => 7.0.4
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.