Skip to content

Typescript messed up #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
Stephcraft opened this issue Apr 12, 2025 · 0 comments
Open
1 of 2 tasks

Typescript messed up #583

Stephcraft opened this issue Apr 12, 2025 · 0 comments
Assignees
Labels

Comments

@Stephcraft
Copy link

Describe the bug

The types are messed up

Image

  • Type errors
  • Exporting the wrong type
  • IEntriesOption is missing

Following the types, usage should be like this, but its invalid:

import { ExtensionReloader } from 'webpack-ext-reloader'

And when using it the other way, typescript 'throws' an error at runtime, so I need to do this:

new (ExtensionReloader as any)({
    port: 8080,
    reloadPage: true,
    manifest: Path.resolve('dist', 'manifest.json'),
    entries: {
        background: 'background',
        extensionPage: 'dashboard'
    }
})

This is a concrete bug in this project, but also this webpack plugin simply does not work. But I have no clue why. Is my config wrong perhaps? Or do I need to run a server of some sort or use this mysterious 8080 port elsewhere?

I particularily want to hotreload extension pages that use React.

Thanks for the clarification

To Reproduce

Use webpack with Typescript.

npx webpack --watch --config webpack.dev.ts
Config
export default const config = {

    mode: 'development',

    ...

    plugins: [

        ...

        new (ExtensionReloader as any)({
            port: 8080,
            reloadPage: true,
            manifest: Path.resolve('dist', 'manifest.json'),
            entries: {
                background: 'background',
                extensionPage: 'dashboard'
            }
        })
    ]
}

Environment:

  • OS: Windows 11
  • Browser Version: Version 1.77.95 Chromium: 135.0.7049.52 (Official Build) (arm64)
  • webpack Version: 5.91.0
  • webpack-ext-reloader Version: 1.1.13

I'm going to open a PR

  • yes
  • no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants