Skip to content

Type misalign between webpack and webpack-sources #12294

Closed
@Austaras

Description

Bug report

In webpack's declarations.d.ts, Source is

export abstract class Source {
		size(): number;

		map(options?: MapOptions): Object;

while in @types/webpack-sources, it is

    map(options?: MapOptions): RawSourceMap | null;

What is the expected behavior?
typing of webpack and webpack-sources should be compatible.

In this case I believe the latter is more detailed, so it should be used. BTW, why doesn't webpack use this declaration but instead write its own?

Other relevant information:
webpack version: 5.11.1

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions