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

fix(resolve): make tryNodeResolve more robust #9170

Closed
wants to merge 12 commits into from

Commits on Nov 14, 2022

  1. Configuration menu
    Copy the full SHA
    165cdef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    606f126 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a94200f View commit details
    Browse the repository at this point in the history
  4. fix: config bundling regression

    Bug introduced in vitejs#10683
    
    Some packages use "require" instead of "default" for CJS entry
    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    296fe46 View commit details
    Browse the repository at this point in the history
  5. fix: respect overrideConditions and isRequire

    …in the `getInlineConditions` function.
    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    4d3c6ac View commit details
    Browse the repository at this point in the history
  6. fix: try resolveExports call with postfix included

    …and avoid breaking certain `tryFsResolve` calls too (like with `es5-ext`)
    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    bb4fbd0 View commit details
    Browse the repository at this point in the history
  7. fix(resolve): make tryNodeResolve more robust

    The "{id}/package.json" lookup done by `resolvePackageData` is insufficient for certain edge cases, like when "node_modules/{dep}" is linked to a directory without a package.json in it. With this PR, you can now import any file from node_modules even if it has no package.json file associated with it. This mirrors the same capability in Node's resolution algorithm.
    
    In addition to supporting more edge cases, this new implementation might also be faster in some cases, since we are doing less lookups than compared to the previous behavior of calling `resolvePackageData` for every path in the `possiblePkgIds` array.
    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    f62843d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    28c2587 View commit details
    Browse the repository at this point in the history
  9. fix: reset all resolvedPkg variables

    …instead of only the resolvedPkgId variable
    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    173ef76 View commit details
    Browse the repository at this point in the history
  10. fix: bugs caught by tests

    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    5115d77 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    fff33dc View commit details
    Browse the repository at this point in the history
  12. chore: fix lint

    aleclarson committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    775ef0b View commit details
    Browse the repository at this point in the history