agadoo
agadoo copied to clipboard
Improve error message when unable to resolve the main module
You can improve this PR by adding a catch handler to the bin file. Should look like this:
require('./index.js')
.check(input)
.then(result => {
const relative = path.relative(process.cwd(), input);
if (result.shaken) {
console.error(`Success! ${relative} is fully tree-shakeable`);
} else {
error(`Failed to tree-shake ${relative}`);
}
})
+ .catch(error);