deno
dff3cbe3 - fix(bundle): preserve raw imports in watch mode (#36040)

Commit
126 days ago
fix(bundle): preserve raw imports in watch mode (#36040) ## Summary - avoid reloading raw import assets as ordinary module graph roots in bundle watch mode - add regression coverage for rebuilding after CSS and TypeScript changes ## Root cause Raw imports are represented as external assets in the module graph, and their contents are fetched by the bundle loader. Watch invalidation passed a changed CSS asset to `ModuleGraph::reload()`, which reloaded the URL as an ordinary root without its `type: "css"` import context. That poisoned the graph and caused every subsequent rebuild to reject the CSS import. External asset entries do not contain source that needs to be refreshed. Esbuild calls the bundle loader again for the changed input, which fetches the current contents, so watch mode now excludes those entries from graph reload while retaining normal reload behavior for source modules. Fixes #36036. ## Validation - `cargo build --bin deno` - `cargo test -p integration_tests --test integration -- watcher::bundle_watch` (3 passed) - `./tools/lint.js` - `./tools/format.js --check` - reproduced the reported HTML/`--outdir` workflow and verified CSS and subsequent TypeScript changes both rebuilt successfully
Author
Parents
Loading