Skip to content
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

How to make it work with webpack and webpack-dev-server #80

Open
maxgalbu opened this issue Nov 28, 2023 · 2 comments
Open

How to make it work with webpack and webpack-dev-server #80

maxgalbu opened this issue Nov 28, 2023 · 2 comments

Comments

@maxgalbu
Copy link

I'm using webpack-dev-server to avoid having to refresh the extension popup page, so I'm not currently starting webpack with webpack -w but with the following code:

var compiler = webpack(configs);
var server = new WebpackDevServer(
    {
        https: false,
        hot: false,
        client: false,
        host: 'localhost',
        port: PORT,
        static: {
            directory: join(__dirname, '../build'),
        },
        devMiddleware: {
            publicPath: `http://localhost:${PORT}/`,
            writeToDisk: true,
        },
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
        allowedHosts: 'all',
    },
    compiler
);

Is it possible to make web-ext run work with the above configuration?

@birtles
Copy link
Collaborator

birtles commented Nov 29, 2023

I'm afraid I'm not familiar with how webpack-dev-server differs from webpack -w.

I use webpack -w and it automatically reloads the options page and re-injects the content scripts, at least on Firefox.

@GabenGar
Copy link

You have writeToDisk option enabled and that means you can point to the html file in your manifest which gets fed to webpack-dev-server.
And yes, it does mean you'll have to manage slightly different manifests for development and production.

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

No branches or pull requests

3 participants