Skip to content

Inlined workers aren't being rebuilt while using lib mode and build --watch #8172

@ivancuric

Description

@ivancuric

Describe the bug

When using vite build --watch and lib mode, workers which are imported and inlined aren't being rebuilt.

In the reproduction linked, you can run npm run watch-lib in one terminal and npm run dev in the other and modify inlineWorker.ts. The lib will rebuild, and the dev server will trigger a reload, but the inlined worker will remain the same.

Possibly related to #3566 and #3909

Reproduction

https://stackblitz.com/edit/vitejs-vite-2cucaj?file=worker/inlineWorker.ts

System Info

System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 69.00 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    npm: 8.10.0 - ~/.volta/tools/image/npm/8.10.0/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
    Firefox: 97.0.1
    Safari: 15.4

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: web workersp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions