Fix bug related to relative path in baseDir.

This fix makes sure the baseDir is resolved using `path.resolve` before using it. This fixes issues with relative paths.