@@ -21,12 +21,18 @@ you're done: the paths in your templates will automatically point to the dev ser
21
21
dev-server Options
22
22
------------------
23
23
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
+
24
30
The ``dev-server `` command supports all the options defined by `webpack-dev-server `_.
25
31
You can set these options via command line options:
26
32
27
33
.. code-block :: terminal
28
34
29
- $ yarn encore dev-server --https -- port 9000
35
+ $ yarn encore dev-server --port 9000
30
36
31
37
You can also set these options using the ``Encore.configureDevServerOptions() ``
32
38
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
58
64
you'll need to also tell the dev-server to use HTTPS. To do this, you can reuse the Symfony web
59
65
server SSL certificate:
60
66
61
- .. code-block :: javascript
67
+ .. code-block :: diff
62
68
63
69
// webpack.config.js
64
70
// ...
65
- const path = require (' path' );
71
+ + const path = require('path');
66
72
67
73
Encore
68
74
// ...
69
75
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
+ + })
75
81
76
- Then make sure you run the ``dev-server `` with the ``--https `` option:
77
82
78
- .. code-block :: terminal
83
+ .. caution ::
79
84
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.
81
88
82
89
CORS Issues
83
90
-----------
@@ -113,3 +120,4 @@ your page. HMR works automatically with CSS (as long as you're using the
113
120
CSS. That is no longer needed.
114
121
115
122
.. _`webpack-dev-server` : https://webpack.js.org/configuration/dev-server/
123
+ .. _`4.0 CHANGELOG` : https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#400-beta0-2020-11-27
0 commit comments