You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a custom rollup plugin that replaces special module identifiers with out-of-band content generated on the basis of that identifier (e.g., import foo from 'special-loader:./module';, where special-loader:./module has a custom Rollup plugin that uses load() to runs a special build on the basis of ./module), Vite will never call the load() method of the plugin for that module again until the dev server is restarted, even if you use this.addWatchFiles() in the plugin to list files as out-of-band dependencies.
Reproduction
https://github.com/lemonmade/vite-example — README has instructions, but the basic gist is to run yarn && yarn dev, then edit worker.js, and note that the updates are never triggered in the actual built file.
System Info
Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Provide a description in this issue that describes the bug.
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 https://github.com/vuejs/vue-next instead.
I assume the fix for this would be similar as #7024, but nonetheless web workers support has been improved a lot since this issue, so the issue you had with workers may be resolved too.
bluwy
changed the title
this.addWatchFile() in the load() method of a Rollup plugin does not trigger an update in the loaded module if that module is not a "real" filethis.addWatchFile() in the load() hook does not work
Nov 13, 2023
Describe the bug
When using a custom rollup plugin that replaces special module identifiers with out-of-band content generated on the basis of that identifier (e.g.,
import foo from 'special-loader:./module';
, wherespecial-loader:./module
has a custom Rollup plugin that usesload()
to runs a special build on the basis of./module
), Vite will never call theload()
method of the plugin for that module again until the dev server is restarted, even if you usethis.addWatchFiles()
in the plugin to list files as out-of-band dependencies.Reproduction
https://github.com/lemonmade/vite-example — README has instructions, but the basic gist is to run
yarn && yarn dev
, then editworker.js
, and note that the updates are never triggered in the actual built file.System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: yarn
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: