Grunt.js set absolute paths

Is there some way I can set grunt to use absolute paths when registering task configurations?

For example, I want to use grunt to run tasks on files outside of its working directory. I know this is possible as you can simply use "../" to exit a grunt project's working directory.

However, I want to set this as a default to the server's document root, something like the equivalent of PHP's $_SERVER['DOCUMENT_ROOT'].

As an example when I set IO on a task at the moment, it looks like this:

files: {
'../../../path/to/outputfile.css': '../../../path/to/inputfile.scss',
}

However I'd like to change it so that the URI is absolute to the server's root by default.

How can I do this?

You can set working directory for Grunt in Gruntfile using grunt.file.setBase(path) or by passing command line argument --base for grunt executable.

Read more about setBase.