Grunt task configuration for target-specific option overrides
0 reputation · 18 Jul 2020, 03:04 UTC
In a standard Gruntfile.js setup, the grunt.initConfig object allows for both global task options and specific target overrides. This structure is intended to reduce redundancy by defining shared settings once while allowing individual targets to modify specific parameters.
When a task is executed via a specific target, the runner must resolve the merge between the general options object and the target-specific configuration. There is uncertainty regarding how Grunt handles deeply nested objects during this merge process—specifically whether it performs a shallow copy or a deep merge of the options.
- Does Grunt perform a deep merge of nested configuration objects when applying target overrides?
- What is the expected behavior when a target defines a property that exists as a nested object in the global options?