Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message and documentation related to 'options.prefix' #122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

msssk
Copy link
Contributor

@msssk msssk commented Feb 23, 2019

README.md: add documentation for options.prefix
index.ts: add error message if options.prefix is not specified with options.main

Fixes #121

@msssk
Copy link
Contributor Author

msssk commented Feb 23, 2019

The logic on line 358 assumes that options.prefix is set.

  • if we change options.prefix to empty string we can prevent the error, but the module still isn't located
  • if we default options.prefix to options.name then the module is located, but output is incorrect
  • always defaulting options.prefix to options.name seems error-prone, so the best approach may just be enforcing explicit usage of options.prefix

@msssk msssk requested a review from dylans February 23, 2019 01:54
Copy link

@vytenisu vytenisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be worth checking if it works with -name, -prefix and --main specified all together when name and prefix do not match. Not sure if this would work.

On the other hand this improves situation a lot. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Main module not found in 3.0.0 (works in 2.1.0)
3 participants