Skip to content

[regression] dev-server --public option failure #1044

Closed
@gorghoa

Description

@gorghoa

Hi,

The option encore dev-server --public used to work to specify which host to use in the manifest.json symfony assets file.

But in the current version (1.6.1), this option fails:

ban@na:/var/www/html$ ./node_modules/.bin/encore dev-server --public http://192.168.1.22:8000
Running webpack-dev-server ...

[webpack-cli] Error: Unknown option '--public'
[webpack-cli] Run 'webpack --help' to see available commands and options

Looking at webpack-encore code, apparently this is expected to be still working (at least it’s tested):

it('dev-server command public', () => {
const testDir = createTestDirectory();
const config = parseArgv(createArgv(['dev-server', '--public', 'https://my-domain:8080']), testDir);
expect(config.devServerPublic).to.equal('https://my-domain:8080');
});

Versions

Package Version
webpack-encore 1.6.1
webpack-dev-server 4.1.1

Notes about our use case

We use webpack-encore in a docker-compose environment. With the encore dev-server running in its own container, and the symfony app in another.

This setup works very well (serving assets and livereload) as long as the browser shares the same host as the docker containers (0.0.0.0, or localhost is ok). But, we are testing with real devices on the local network (with ips like 192.168.0.12, or even virtualhosts), and currently it seems that we cannot specify the public host to put in the manifest.json.

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions