Describe the bug
It might be a case of me holding it wrong (hopefully), but I've been using the experimental version of vite@7.x with Rolldown for quite some time, but when moving to vite@8.0.7 my icon imports failed to produce icon files in the production build.
From what I could tell it seems to no longer produce files when a custom resolve.alias is used, even though the documentation states this is fine:
The glob patterns are treated like import specifiers: they must be ... or an alias path (see resolve.alias option).
As shown in the reproduction, the below seems to work in dev mode and produces files with npm run build:
import.meta.glob([
'./../../assets/icons/*.svg',
])
Build 1. output
✓ 18 modules transformed.
computing gzip size...
dist/index.html 0.55 kB │ gzip: 0.34 kB
dist/assets/index-TZrNw7dA.css 0.01 kB │ gzip: 0.03 kB
dist/assets/red-BepeEtnz.js 0.29 kB │ gzip: 0.24 kB
dist/assets/blue-DWrjRoGJ.js 0.29 kB │ gzip: 0.24 kB
dist/assets/green-DreAtH0R.js 0.29 kB │ gzip: 0.24 kB
dist/assets/index-D7mQFbHq.js 8.62 kB │ gzip: 3.87 kB
dist/assets/runtime-core.esm-bundler-BBKSmmss.js 54.22 kB │ gzip: 21.36 kB
✓ built in 526ms
While the following works in dev mode, but fails to produce files after running npm run build:
import.meta.glob([
'@customIcons/*.svg',
])
Build 2. output
✓ 14 modules transformed.
computing gzip size...
dist/index.html 0.45 kB │ gzip: 0.30 kB
dist/assets/index-TZrNw7dA.css 0.01 kB │ gzip: 0.03 kB
dist/assets/index-iHsm0tXg.js 60.94 kB │ gzip: 24.16 kB
✓ built in 449ms
Reproduction
https://stackblitz.com/edit/vitejs-vite-h33s9nrs?file=src%2Fcomponents%2Ficon%2FIcon.vue
Steps to reproduce
npm install
- Uncomment (or comment) either
1. or 2. in Icon.vue in import.meta.glob and AsyncIconComponent
- Run
npm run dev and npm run build to see the differences in build output.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 22.22.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@vitejs/plugin-vue: ^6.0.5 => 6.0.5
vite: ^8.0.7 => 8.0.7
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
It might be a case of me holding it wrong (hopefully), but I've been using the experimental version of
vite@7.xwith Rolldown for quite some time, but when moving tovite@8.0.7my icon imports failed to produce icon files in the production build.From what I could tell it seems to no longer produce files when a custom
resolve.aliasis used, even though the documentation states this is fine:As shown in the reproduction, the below seems to work in
devmode and produces files withnpm run build:Build 1. output
✓ 18 modules transformed. computing gzip size... dist/index.html 0.55 kB │ gzip: 0.34 kB dist/assets/index-TZrNw7dA.css 0.01 kB │ gzip: 0.03 kB dist/assets/red-BepeEtnz.js 0.29 kB │ gzip: 0.24 kB dist/assets/blue-DWrjRoGJ.js 0.29 kB │ gzip: 0.24 kB dist/assets/green-DreAtH0R.js 0.29 kB │ gzip: 0.24 kB dist/assets/index-D7mQFbHq.js 8.62 kB │ gzip: 3.87 kB dist/assets/runtime-core.esm-bundler-BBKSmmss.js 54.22 kB │ gzip: 21.36 kB ✓ built in 526msWhile the following works in dev mode, but fails to produce files after running
npm run build:Build 2. output
✓ 14 modules transformed. computing gzip size... dist/index.html 0.45 kB │ gzip: 0.30 kB dist/assets/index-TZrNw7dA.css 0.01 kB │ gzip: 0.03 kB dist/assets/index-iHsm0tXg.js 60.94 kB │ gzip: 24.16 kB ✓ built in 449msReproduction
https://stackblitz.com/edit/vitejs-vite-h33s9nrs?file=src%2Fcomponents%2Ficon%2FIcon.vue
Steps to reproduce
npm install1.or2.inIcon.vueinimport.meta.globandAsyncIconComponentnpm run devandnpm run buildto see the differences in build output.System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 22.22.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: @vitejs/plugin-vue: ^6.0.5 => 6.0.5 vite: ^8.0.7 => 8.0.7Used Package Manager
npm
Logs
No response
Validations