symfony / webpack-encore

A simple but powerful API for processing & compiling assets built around Webpack
https://symfony.com/doc/current/frontend.html
MIT License
2.23k stars 198 forks source link

Dev server HTTPS options are overwritten with --https set #782

Open Addvilz opened 4 years ago

Addvilz commented 4 years ago

When --https is set using command line, https options in dev server configuration are overriden and generated certificate is used instead of the one provided.

If --https is not set using command line but https options are set in dev server configuration, entrypoints.json are generated using http:// prefix instead of https://. Dev server serves all content over https as expected.

I could accept a need to use both config and cli flag, just that having the CLI flag should not overwrite dev server config.

In webpack.config.js

  // ...
  .configureDevServerOptions(config => {
    config.http2 = true;
    config.https = {
      key: '/etc/ssl/server.key',
      cert: '/etc/ssl/server.crt'
    }
  })
 // ...
hailwood commented 4 years ago

@Addvilz

You can use --https --key /etc/ssl/server.key --cert /etc/ssl/server.crt

Addvilz commented 4 years ago

@hailwood

Thanks for the tip, looks like a decent workaround! Nevertheless, https options should still probably be honoured. I haven't looked into it besides key and cert, but I suspect there might be other options that are affected too.

hailwood commented 4 years ago

I actually ran into this using another wrapper around webpack dev server, so I believe the issue may actually be there An not encore specific

On Fri, 5 Jun 2020, 20:58 Matīss, notifications@github.com wrote:

@hailwood https://github.com/hailwood

Thanks for the tip, looks like a decent workaround! Nevertheless, https options should still probably be honoured. I haven't looked into it besides key and cert, but I suspect there might be other options that are affected too.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/symfony/webpack-encore/issues/782#issuecomment-639352471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFNJDNXWHGX3ZQIAG6FL23RVCXUBANCNFSM4NPH34OQ .