-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Describe the bug
rolldown-vite v7.2.10 building client environment for production...
[plugin builtin:vite-import-glob] Invalid glob pattern: @@@/node_modules/@fe-design//app/web/router/.{js,jsx} in file 'router/plugin-route.tsx'. Glob patterns must start with:
• '/' for absolute paths from project root
• './' or '../' for relative paths
• '**/' for recursive matching from project root
• '#' for subpath imports (with '*' wildcard)
vite-import-glob还是有问题,我之前的
const modules = import.meta.glob<{ default: { view: LazyExoticComponent<() => JSX.Element> } }>(
['@@@/node_modules/@fe-design//app/web/router/.{js,jsx}', '@@@/plugin//app/web/router/.{ts,tsx}'],
{ eager: true, exhaustive: true },
);
代码在vite下是能正常工作的,现在rolldown-vite在dev时也能正常工作,但是build时就会报这个问题,vite config中也配置了
resolve: {
alias: {
'@@@': path.resolve(__dirname),
'@@': path.resolve(__dirname, './app'),
'@': path.resolve(__dirname, './app/web'),
},
},
猜测是vite-import-glob比vite-alias先执行导致拿不到alias
Reproduction
https://stackblitz.com/edit/vitejs-rolldown-vite-g3f1ejt3?file=app%2Fweb%2Fmain.tsx
Steps to reproduce
No response
System Info
System:
OS: macOS 26.1
CPU: (8) arm64 Apple M3
Memory: 147.89 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.11.1 - /Users/panjiazhi/.volta/tools/image/node/24.11.1/bin/node
Yarn: 4.3.1 - /Users/panjiazhi/.volta/tools/image/yarn/4.3.1/bin/yarn
npm: 11.6.2 - /Users/panjiazhi/.volta/tools/image/node/24.11.1/bin/npm
pnpm: 10.20.0 - /Users/panjiazhi/.volta/bin/pnpm
Deno: 2.1.1 - /Users/panjiazhi/.deno/bin/deno
Browsers:
Chrome: 143.0.7499.41
Safari: 26.1
npmPackages:
@vitejs/plugin-react: ^5.1.1 => 5.1.1
rolldown-vite: 7.2.10Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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.