-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wrangler): Fix
pages dev
watch mode [_worker.js] (#6150)
* fix(wrangler): Fix `pages dev` watch mode [_worker.js] The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824 * fixes
- Loading branch information
1 parent
5623aa2
commit d993409
Showing
3 changed files
with
314 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: Fix `pages dev` watch mode [_worker.js] | ||
|
||
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the "\_worker.js" file, but not for changes in any of its imported dependencies. This means that given the following "\_worker.js" file | ||
|
||
``` | ||
import { graham } from "./graham-the-dog"; | ||
export default { | ||
fetch(request, env) { | ||
return new Response(graham) | ||
} | ||
} | ||
``` | ||
|
||
`pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. | ||
|
||
Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. | ||
|
||
This commit fixes all the aforementioned issues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.