-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
bug: pending triageMaybe a bug, waiting for confirmationMaybe a bug, waiting for confirmation
Description
Describe the bug
I am deploying a vitepress app with cloudflare workers and the images will be hosted on cloudflare R2.
I tried adding this to the config
vite: {
build: {
rollupOptions: {
external: /^\/media\//,
},
},
},to exclude all paths starting with /media/.
But in a test page containing
The build fails trying to process the asset:
✖ rendering pages...
build error:
Cannot find module '/media/remote-image.png'
Reproduction
add an image  and mark all imports starting with /media/ as external:
export default defineConfig({
vite: {
build: {
rollupOptions: {
external: /^\/media\//,
},
},
},
});Expected behavior
All excluded assets will be ignored during the build process and included as plain urls.
<img alt="alt" src="/media/remote-image.png" />
System Info
System:
OS: macOS 15.7
CPU: (8) arm64 Apple M3
Memory: 213.20 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.17.0 - /Users/everdrone/.local/state/fnm_multishells/42219_1760630691922/bin/node
npm: 10.9.2 - /Users/everdrone/.local/state/fnm_multishells/42219_1760630691922/bin/npm
pnpm: 10.11.1 - /Users/everdrone/Library/pnpm/pnpm
Browsers:
Chrome: 141.0.7390.78
Firefox: 144.0
Safari: 26.0.1
npmPackages:
vitepress: ^1.6.4 => 1.6.4
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
bug: pending triageMaybe a bug, waiting for confirmationMaybe a bug, waiting for confirmation