support when package.json main is a dir (not file)