Skip to content

Conversation

weaverryan
Copy link
Member

Hi!

Fixes #903

If you pass --https at the command line, that overrides your devServer.https config. In webpack-dev-server v3, that wasn't a problem. But in v4, the certificate config was moved under devServer.https, which can now be an object. This meant that if you passed --https at the command line (which Encore previously required) but also set devServer.https = { ... }, that would be "re-set" back to devServer.https = true and your config would be lost.

The fix is to not require the --https flag and look at it or the user's config to determine if the dev-server is running in https.

Cheers!

}
}

if (this.webpackConfig.useDevServer()) {
Copy link
Member

@Kocal Kocal Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this, since we already check this.webpackConfig.useDevServer() before?

Suggested change
if (this.webpackConfig.useDevServer()) {
if (null !== devServerConfig) {

If you pass --https at the command line, that overrides your
devServer.https config. In webpack-dev-server v3, that wasn't
a problem. But in v4, the certificate config was moved under devServer.https,
which can now be an object. This meant that if you passed --https at
the command line but also set devServer.https = { ... }, it would
be "re-set" back to "true" and your config would be lost.

The fix is to not require the --https flag and look at it or the user's
config to determine if the dev-server is running in https.
@weaverryan weaverryan force-pushed the fixing-https-dev-server branch from 86210d6 to ee417f0 Compare February 6, 2021 18:31
@weaverryan weaverryan merged commit 0fa10e4 into symfony:main Feb 6, 2021
@weaverryan weaverryan deleted the fixing-https-dev-server branch February 6, 2021 20:39
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Feb 8, 2021
This PR was merged into the 5.2 branch.

Discussion
----------

[Encore] dev-server https fix updates

See symfony/webpack-encore#917

Cheers!

Commits
-------

7332254 Adding notes related to the dev-server https fix in Encore
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

Successfully merging this pull request may close these issues.

When using dev-server https option manifests and paths in CSS files are still http:// instead of https://
2 participants