Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wrangler): Watch for external dependencies changes in pages dev #6022

Merged
merged 1 commit into from
Jul 2, 2024

Commits on Jul 2, 2024

  1. fix(wrangler): Fix pages dev watch mode [Functions]

    The watch mode in `pages dev` for Pages Functions
    projects is currently partially broken, as it only
    watches for file system changes in the "/functions"
    directory, but not for changes in any of the Functions'
    dependencies. This means that given a Pages Function
    "math-is-fun.ts", defined as follows:
    
    ```
    import { ADD } from "../math/add";
    
    export async function onRequest() {
      return new Response(`${ADD} is fun!`);
    }
    ```
    
    `pages dev` will reload for any changes in
    "math-is-fun.ts" itself, but not for any changes in
    "math/add.ts", 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 these things, plus adds some extra
    polish to the `pages dev` watch mode experience.
    
    Fixes #3840
    CarmenPopoviciu committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    50aa43c View commit details
    Browse the repository at this point in the history