Skip to content

Commit

Permalink
Only warn when "main" is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Apr 25, 2019
1 parent f223878 commit 0dce43c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/npm_install/generate_build_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,11 @@ node_module_library(
// check if main entry point exists
mainEntryPoint = findFile(pkg, mainEntryPoint) || findFile(pkg, `${mainEntryPoint}.js`);
if (!mainEntryPoint) {
// "main" entry point listed could not be resolved to a file
console.error(`Could not find "main" entry point ${pkg.main} in npm package ${pkg._name}`);
process.exit(1);
// If "main" entry point listed could not be resolved to a file
// then don't create an npm_amd_bundle target. This can happen
// in some npm packages that list an incorrect main such as v8-coverage@1.0.8
// which lists `"main": "index.js"` but that file does not exist.
console.warn(`Could not find "main" entry point ${pkg.main} in npm package ${pkg._name}`);
}
} else {
// if "main" is not specified then look for an index.js
Expand Down

0 comments on commit 0dce43c

Please # to comment.