Skip to content

Commit

Permalink
Fix error in case bundle.getMainEntry() returns null
Browse files Browse the repository at this point in the history
prevents vseventer#3
  • Loading branch information
ap-- committed Oct 5, 2021
1 parent de40623 commit dcb6325
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export default new Namer({
return bundle.filePath;
}

const { filePath: bundlePath } = bundle.getMainEntry();
const mainEntry = bundle.getMainEntry();
if (!mainEntry) {
return null;
}
const { filePath: bundlePath } = mainEntry;
const { projectRoot } = options;
const pluginConfig = await getPluginConfig(projectRoot);

Expand Down

0 comments on commit dcb6325

Please sign in to comment.