Skip to content

Improper module declaration #12

@ghost

Description

Importing the plugin when using TypeScript to write webpack configuration with
import InjectBodyPlugin from 'inject-body-webpack-plugin';
as suggested by the Example section in readme.md yields

error TS2351: This expression is not constructable.
Type 'typeof import("inject-body-webpack-plugin")' has no construct signatures.
by the TypeScript compiler even though if type checking is skipped no error occurs.

I think the problem is with generated module declaration in index.d.ts.
If we replace export class InjectBodyPlugin with export default class InjectBodyPlugin error no longer occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions