Describe the bug
When running vitejs in dev mode:
If you load an asset using fetch(new URL('./some-image.png, import.meta.url).href), the app is expected to reload when the asset changes. However nothing appends.
function run() {
const url = new URL('./markdown.md', import.meta.url).href;
console.log(`reload: ${Date.now()} - ${url}`);
}
run();
https://stackblitz.com/edit/vite-jeafy9?file=main.ts
On my point of view, the app should reload if the imported assets change. It may be useful if we have, for example, a markdown to html preview component. Currently, if we update the .md file, nothing happen.
Reproduction
https://stackblitz.com/edit/vite-jeafy9?file=main.ts
System Info
System:
OS: Linux 5.4 Zorin OS 15.3
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 1.36 GB / 31.00 GB
Container: Yes
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node
Yarn: 1.22.5 - /usr/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.9.0/bin/npm
Browsers:
Firefox: 93.0
npmPackages:
vite: ^2.5.7 => 2.5.7
Used Package Manager
yarn
Logs
No response
Validations
Describe the bug
When running vitejs in dev mode:
If you load an asset using
fetch(new URL('./some-image.png, import.meta.url).href), the app is expected to reload when the asset changes. However nothing appends.https://stackblitz.com/edit/vite-jeafy9?file=main.ts
On my point of view, the app should reload if the imported assets change. It may be useful if we have, for example, a markdown to html preview component. Currently, if we update the
.mdfile, nothing happen.Reproduction
https://stackblitz.com/edit/vite-jeafy9?file=main.ts
System Info
System: OS: Linux 5.4 Zorin OS 15.3 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Memory: 1.36 GB / 31.00 GB Container: Yes Shell: 4.4.20 - /bin/bash Binaries: Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node Yarn: 1.22.5 - /usr/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v14.9.0/bin/npm Browsers: Firefox: 93.0 npmPackages: vite: ^2.5.7 => 2.5.7Used Package Manager
yarn
Logs
No response
Validations