Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions frontend/encore/dev-server.rst
Original file line number Diff line number Diff line change
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.
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed as the note was pretty old now


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.
Copy link
Member Author

Choose a reason for hiding this comment

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

That version is now very old, so just some housekeeping


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.
Copy link
Member Author

Choose a reason for hiding this comment

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

The first part of the note is now quite old as 1.0 was released about 2 years ago. For the second part (about overridden), I can't find anything in the code that would suggest that also passing --https would cause any type of overriding.


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

Expand Down