Skip to content

Commit c831050

Browse files
javiereguiluzxabbuh
authored andcommitted
minor symfony#9167 Improved the docs about multiple Webpack configs (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Improved the docs about multiple Webpack configs This fixes symfony#9166. Commits ------- 68c92e9 Improved the docs about multiple Webpack configs
1 parent 7a9a193 commit c831050

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

frontend/encore/advanced-config.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ state of the current configuration to build a new one:
6363
// build the first configuration
6464
const firstConfig = Encore.getWebpackConfig();
6565
66+
// Set a unique name for the config (needed later!)
67+
firstConfig.name = 'firstConfig';
68+
6669
// reset Encore to build the second config
6770
Encore.reset();
6871
@@ -79,9 +82,19 @@ state of the current configuration to build a new one:
7982
// build the second configuration
8083
const secondConfig = Encore.getWebpackConfig();
8184
85+
// Set a unique name for the config (needed later!)
86+
secondConfig.name = 'secondConfig';
87+
8288
// export the final configuration as an array of multiple configurations
8389
module.exports = [firstConfig, secondConfig];
8490
91+
When running Encore, both configurations will be built in parallel. If you
92+
prefer to build configs separately, pass the ``--config-name`` option:
93+
94+
.. code-block:: terminal
95+
96+
$ yarn run encore dev --config-name firstConfig
97+
8598
.. _`configuration options`: https://webpack.js.org/configuration/
8699
.. _`Webpack's watchOptions`: https://webpack.js.org/configuration/watch/#watchoptions
87100
.. _`array of configurations`: https://github.com/webpack/docs/wiki/configuration#multiple-configurations

0 commit comments

Comments
 (0)