My problem was a conflict between requirejs task options and the mainConfigFile. I wanted to use the same config file from the submodule in the main project but there is a different base url configured (submodule/js/ -> js/).
I haven't found a way to override options from the config file so I had to copy them to the task configuration. It isn't pretty but at least it works now.