grunt
grunt copied to clipboard
Allow config to have circular dependencies
Im trying to solve webpack/grunt-webpack#61 which throws an error if the config in the Gruntfile.js contains a circular reference (see stacktrace at the end).
The first assumption was that we access the config in a wrong way which triggers this check and we can access the config in a different way to circumvent this check. (webpack/grunt-webpack#62 and described in this comment https://github.com/gruntjs/grunt/issues/1435#issuecomment-174752636)
Now this seems not to be valid anymore, as grunt now throws always even if the task does not do anything. This can also be seen in the stacktrace as grunt-webpack is nowhere to be found in there.
Can we make grunt somehow either handle circular dependencies gracefully or have an option for tasks again to circumvent the circular check?
Warning: Circular reference detected (.plugins[0].circle) Use --force to continue.
Error: Circular reference detected (.plugins[0].circle)
at recurse (/grunt-webpack/node_modules/grunt-legacy-util/index.js:99:15)
at recurse (/grunt-webpack/node_modules/grunt-legacy-util/index.js:119:20)
at /grunt-webpack/node_modules/grunt-legacy-util/index.js:110:16
at Array.map (native)
at recurse (/grunt-webpack/node_modules/grunt-legacy-util/index.js:109:20)
at recurse (/grunt-webpack/node_modules/grunt-legacy-util/index.js:119:20)
at Object.util.recurse (/grunt-webpack/node_modules/grunt-legacy-util/index.js:130:10)
at Function.config.process (/grunt-webpack/node_modules/grunt/lib/grunt/config.js:52:21)
at Function.config.get (/grunt-webpack/node_modules/grunt/lib/grunt/config.js:46:17)
at /grunt-webpack/node_modules/grunt/lib/grunt/config.js:98:19
at Array.filter (native)
at Object.config.requires [as requiresConfig] (/grunt-webpack/node_modules/grunt/lib/grunt/config.js:97:40)
at Object.<anonymous> (/grunt-webpack/node_modules/grunt/lib/grunt/task.js:225:10)
at Object.thisTask.fn (/grunt-webpack/node_modules/grunt/lib/grunt/task.js:73:16)
at Object.<anonymous> (/grunt-webpack/node_modules/grunt/lib/util/task.js:294:30)
at Task.runTaskFn (/grunt-webpack/node_modules/grunt/lib/util/task.js:244:24)
at Task.<anonymous> (/grunt-webpack/node_modules/grunt/lib/util/task.js:293:12)
at /grunt-webpack/node_modules/grunt/lib/util/task.js:220:11
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3