Instead of path.join(projectBaseDir, srcDir), we should use path.resolve(projectBaseDir, srcDir). Where join() will always join paths, resolve() will resolve relative paths relative to the previous argument, but leave absolute paths alone.
I checked that the new test case fails without the fix (converting path.join to path.resolve every time projectBaseDir is involved), but passes with the fix. Please take a look!
Instead of path.join(projectBaseDir, srcDir), we should use path.resolve(projectBaseDir, srcDir). Where join() will always join paths, resolve() will resolve relative paths relative to the previous argument, but leave absolute paths alone.
Closes #15