Skip to content

Commit b7f7b81

Browse files
MarshallOfSoundmalept
authored andcommitted
fix(packager): throw errors on an uncompilable entrypoint
Fixes #66
1 parent 761464f commit b7f7b81

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/api/package.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ export default async (providedOptions = {}) => {
5050

5151
const packageJSON = await readPackageJSON(dir);
5252

53+
if (path.dirname(require.resolve(path.resolve(dir, packageJSON.main))) === dir) {
54+
console.error(`${packageJSON.main}`.red);
55+
// eslint-disable-next-line no-throw-literal
56+
throw 'The entrypoint to your application ("packageJSON.name") must be in a subfolder not in the top level directory';
57+
}
58+
5359
const forgeConfig = await getForgeConfig(dir);
5460
let packagerSpinner;
5561

0 commit comments

Comments
 (0)