davidje13 / neutrino-typescript

Transpiles TypeScript as part of the build process.
MIT License
8 stars 2 forks source link

fix: [#2] addIfAbsent must resolve module before comparison #3

Closed moarcaffeine closed 4 years ago

moarcaffeine commented 4 years ago

Current check is comparing names to resolved modules. Fix for issue #2.

davidje13 commented 4 years ago

Interesting that I haven't seen the bug you describe myself (maybe it's OS-specific or only manifests for projects in paths with capital letters, etc.). This change looks fine, but 2 comments:

  1. Is includes still needed, or is straightforward equality checking sufficient?
  2. I assume require.resolve is somewhat expensive, so can you pull it out into a variable to avoid computing it for each check? (if it does its own internal caching then nevermind)

I can merge and push a new release tomorrow.