From 68c92e901e53f953e5ec85027e2c96372a815901 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 29 Jan 2018 16:30:20 +0100 Subject: [PATCH] Improved the docs about multiple Webpack configs --- frontend/encore/advanced-config.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/encore/advanced-config.rst b/frontend/encore/advanced-config.rst index 12f8a0b69d8..e66440ac43f 100644 --- a/frontend/encore/advanced-config.rst +++ b/frontend/encore/advanced-config.rst @@ -63,6 +63,9 @@ state of the current configuration to build a new one: // build the first configuration const firstConfig = Encore.getWebpackConfig(); + // Set a unique name for the config (needed later!) + firstConfig.name = 'firstConfig'; + // reset Encore to build the second config Encore.reset(); @@ -79,9 +82,19 @@ state of the current configuration to build a new one: // build the second configuration const secondConfig = Encore.getWebpackConfig(); + // Set a unique name for the config (needed later!) + secondConfig.name = 'secondConfig'; + // export the final configuration as an array of multiple configurations module.exports = [firstConfig, secondConfig]; +When running Encore, both configurations will be built in parallel. If you +prefer to build configs separately, pass the ``--config-name`` option: + +.. code-block:: terminal + + $ yarn run encore dev --config-name firstConfig + .. _`configuration options`: https://webpack.js.org/configuration/ .. _`Webpack's watchOptions`: https://webpack.js.org/configuration/watch/#watchoptions .. _`array of configurations`: https://github.com/webpack/docs/wiki/configuration#multiple-configurations