Skip to content

[Feature]: Mark import.meta.webpackHot type signature as optional #11631

@yf-yang

Description

@yf-yang

What problem does this feature solve?

Currently, when referencing @rsbuild/core/types, ImportMeta type is

interface ImportMeta {
    url: string;
    // TODO: unsupported
    // webpack: number;
    webpackHot: Rspack.Hot;
   // ...
}

Cann we make webpackHot be optional, so that it matches the documentation that it may not necessarily exist? (If I got it right, during SSR it does not exist, if this is not expected I'll fire a bug report)
https://rspack.rs/api/runtime-api/hmr#example

What does the proposed API look like?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions