-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Closed
Copy link
Labels
has workaroundp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)windows only
Description
Describe the bug
If build.rollupOptions.input is relative path, like below,
import { defineConfig } from 'vite';
export default defineConfig({
build: {
rollupOptions: {
input: {
main: 'src/main.js',
'lib/example': 'src/lib/example.js',
},
},
},
});the module is duplicated only on Windows. (In this example, src/lib/example.js is bundled twice. (This doesn't happen with rollup)
The workaround is to call path.resolve() (e.g. path.resolve('src/lib/example.js').
Reproduction
https://stackblitz.com/edit/rollup-repro-kizyn2?file=vite.config.js
Steps to reproduce
No response
System Info
System:
OS: Windows 11 10.0.22621
CPU: (16) x64 13th Gen Intel(R) Core(TM) i7-1360P
Memory: 16.73 GB / 31.62 GB
Binaries:
Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.3.1 - C:\Program Files\nodejs\pnpm.CMD
Browsers:
Edge: Chromium (119.0.2151.72)
Internet Explorer: 11.0.22621.1
npmPackages:
rollup: ^4.5.0 => 4.6.0
vite: ^5.0.2 => 5.0.2Used 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
has workaroundp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)windows only