Skip to content

Commit

Permalink
minor #16833 [Encore] Changing dev-server to use the new server optio…
Browse files Browse the repository at this point in the history
…n (weaverryan)

This PR was merged into the 5.4 branch.

Discussion
----------

[Encore] Changing dev-server to use the new server option

See: symfony/webpack-encore#1125

But it is NOT dependent on that PR. These changes are already "good change" and do not require changes to Encore.

Commits
-------

0029c27 [Encore] Changing dev-server to use the new server option
  • Loading branch information
javiereguiluz committed May 31, 2022
2 parents 3ce1fd9 + 0029c27 commit af83280
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions frontend/encore/dev-server.rst
Expand Up @@ -25,12 +25,6 @@ you're done: the paths in your templates will automatically point to the dev ser
dev-server Options
------------------

.. caution::

Encore uses ``webpack-dev-server`` version 4, which at the time of Encore's
1.0 release was still in beta and was not documented. See the `4.0 CHANGELOG`_
for changes.

The ``dev-server`` command supports all the options defined by `webpack-dev-server`_.
You can set these options via command line options:

Expand All @@ -54,16 +48,16 @@ method in your ``webpack.config.js`` file:
// ...
.configureDevServerOptions(options => {
options.https = {
key: '/path/to/server.key',
cert: '/path/to/server.crt',
options.server = {
type: 'https',
options: {
key: '/path/to/server.key',
cert: '/path/to/server.crt',
}
}
})
;
.. versionadded:: 0.28.4

The ``Encore.configureDevServerOptions()`` method was introduced in Encore 0.28.4.
Enabling HTTPS using the Symfony Web Server
-------------------------------------------
Expand All @@ -82,18 +76,14 @@ server SSL certificate:
// ...
+ .configureDevServerOptions(options => {
+ options.https = {
+ pfx: path.join(process.env.HOME, '.symfony/certs/default.p12'),
+ options.server = {
+ type: 'https',
+ options: {
+ pfx: path.join(process.env.HOME, '.symfony/certs/default.p12'),
+ }
+ }
+ })
.. caution::

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

CORS Issues
-----------

Expand Down

0 comments on commit af83280

Please sign in to comment.