Write the .map file in the same directory as the output file.

Fixes #1538
I changed it to test `string.length > 0`.