Skip to content

Commit

Permalink
fix(core): check packageJSON.main is set and don't enforce subdir rule
Browse files Browse the repository at this point in the history
Fixes #497
Fixes #498
  • Loading branch information
MarshallOfSound committed Apr 30, 2018
1 parent c46e023 commit ebd9a95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ export default async ({

const packageJSON = await readPackageJSON(dir);

if (path.dirname(require.resolve(path.resolve(dir, packageJSON.main))) === dir) {
console.error(`Entry point: ${packageJSON.main}`.red);
throw 'The entry point to your application ("packageJSON.main") must be in a subfolder not in the top level directory';
if (!packageJSON.main) {
throw 'packageJSON.main must be set to a valid entry point for your Electron app';
}

const forgeConfig = await getForgeConfig(dir);
Expand Down

0 comments on commit ebd9a95

Please sign in to comment.