Skip to content

Commit 0aed669

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Encore: add documentation for Encore.configureDevServerOptions()
2 parents 348a8bb + 054add5 commit 0aed669

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

frontend/encore/dev-server.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,35 @@ Twig shortcuts (or are :ref:`processing your assets through entrypoints.json <lo
1717
in some other way), you're done: the paths in your templates will automatically point
1818
to the dev server.
1919

20-
You can also pass options to the ``dev-server`` command: any options that are supported
21-
by the normal `webpack-dev-server`_. For example:
20+
The ``dev-server`` command supports all the options defined by `webpack-dev-server`_.
21+
You can set these options via command line options:
2222

2323
.. code-block:: terminal
2424
2525
$ yarn encore dev-server --https --port 9000
2626
27-
This will start a server at ``https://localhost:9000``.
27+
You can also set these options using the ``Encore.configureDevServerOptions()``
28+
method in your ``webpack.config.js`` file:
29+
30+
.. code-block:: javascript
31+
32+
// webpack.config.js
33+
// ...
34+
35+
Encore
36+
// ...
37+
38+
.configureDevServerOptions(options => {
39+
options.https = {
40+
key: '/path/to/server.key',
41+
cert: '/path/to/server.crt',
42+
}
43+
})
44+
;
45+
46+
.. versionadded:: 0.28.4
47+
48+
The ``Encore.configureDevServerOptions()`` method was introduced in Encore 0.28.4.
2849

2950
Hot Module Replacement HMR
3051
--------------------------

0 commit comments

Comments
 (0)