In YAML config files, use the when@... special key:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# config/packages/webpack_encore.yaml
webpack_encore:
    # ...
    output_path: '%kernel.project_dir%/public/build'
    strict_mode: true
    cache: false

when@prod:
    webpack_encore:
        cache: true

when@test:
    webpack_encore:
        strict_mode: false

Powered by Froala Editor