gruntjs / gruntjs/grunt

grunt.initConfig uses object and grunt.config.merge create hashmap

Open
#1,228 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

When breaking apart to multiple grunt task files, if you attempt to use grunt.initConfig (for the main file) and grunt.config.merge (downstream) you go from grunt.config being a function type to a hashmap type.

This causes issues when using some third party plugins like useminPrepare since you get two different representations of grunt.config (they assume grunt.config() ).

Ideally you should be able to initialize and merge and still end up with grunt.config being a function or you should throw an error if you try to use grunt.initconfig and grunt.config.merge

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the interaction between grunt.initConfig and grunt.config.merge described in the issue, then trace how each operation changes grunt.config. Done means initialization and merging preserve the callable grunt.config representation, or the incompatible combination reports an explicit error, with third-party plugin behavior covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.