Skip to content

Commit 33b1b89

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Adding notes related to the dev-server https fix in Encore
2 parents f5ab1e1 + 39c8def commit 33b1b89

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

frontend/encore/dev-server.rst

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ you're done: the paths in your templates will automatically point to the dev ser
2121
dev-server Options
2222
------------------
2323

24+
.. caution::
25+
26+
Encore uses ``webpack-dev-server`` version 4, which at the time of Encore's
27+
1.0 release was still in beta and was not documented. See the `4.0 CHANGELOG`_
28+
for changes.
29+
2430
The ``dev-server`` command supports all the options defined by `webpack-dev-server`_.
2531
You can set these options via command line options:
2632

2733
.. code-block:: terminal
2834
29-
$ yarn encore dev-server --https --port 9000
35+
$ yarn encore dev-server --port 9000
3036
3137
You can also set these options using the ``Encore.configureDevServerOptions()``
3238
method in your ``webpack.config.js`` file:
@@ -58,26 +64,27 @@ If you're using the :doc:`Symfony web server </setup/symfony_server>` locally wi
5864
you'll need to also tell the dev-server to use HTTPS. To do this, you can reuse the Symfony web
5965
server SSL certificate:
6066

61-
.. code-block:: javascript
67+
.. code-block:: diff
6268
6369
// webpack.config.js
6470
// ...
65-
const path = require('path');
71+
+ const path = require('path');
6672
6773
Encore
6874
// ...
6975
70-
.configureDevServerOptions(options => {
71-
options.https = {
72-
pfx: path.join(process.env.HOME, '.symfony/certs/default.p12'),
73-
}
74-
})
76+
+ .configureDevServerOptions(options => {
77+
+ options.https = {
78+
+ pfx: path.join(process.env.HOME, '.symfony/certs/default.p12'),
79+
+ }
80+
+ })
7581
76-
Then make sure you run the ``dev-server`` with the ``--https`` option:
7782
78-
.. code-block:: terminal
83+
.. caution::
7984

80-
$ yarn encore dev-server --https
85+
Make sure to **not** pass the ``--https`` flag at the command line when
86+
running ``encore dev-server``. This flag was required before 1.0, but now
87+
will cause your config to be overridden.
8188

8289
CORS Issues
8390
-----------
@@ -116,4 +123,5 @@ your page. HMR works automatically with CSS (as long as you're using the
116123
CSS. That is no longer needed.
117124

118125
.. _`webpack-dev-server`: https://webpack.js.org/configuration/dev-server/
119-
.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
126+
.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
127+
.. _`4.0 CHANGELOG`: https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#400-beta0-2020-11-27

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy