Skip to content

addWatchFile dose not work when using rspack bundler with virtual module id returned by resolveId #554

@tangye1234

Description

@tangye1234

Environment

node: 24
rspack core: 1.5.8
unplugin: 2.3.10

Reproduction

Plugin can work in vitejs, but not rspack.

When I setup my own unplugin in rspack dev mode, where the file is resolved as a virtual module, and re-resolved to the real path in load hook, and add it to the watch file. Then I modify the original source, the resolve id and load won't be called any longer.

In my rspack, we have normal css rules, and a plugin which will process a special css file, I don't wont it to be processed by the other css rules, it is a plugin who try to resolve it to another virtual module(not a css file with a unique extention).

I will provide the minimum reproduction in my spare time.

Describe the bug

The hmr won't work in rspack with virtual module.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions