From 0029c274624e063779d0fce2b196a26f1c26747a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 31 May 2022 13:31:49 -0400 Subject: [PATCH] [Encore] Changing dev-server to use the new server option --- frontend/encore/dev-server.rst | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/frontend/encore/dev-server.rst b/frontend/encore/dev-server.rst index f0974197f1b..c017a35fcc2 100644 --- a/frontend/encore/dev-server.rst +++ b/frontend/encore/dev-server.rst @@ -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: @@ -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 ------------------------------------------- @@ -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 -----------