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 format assumption when resolving module dependencies #10878

Merged
merged 2 commits into from
Mar 27, 2023

Commits on Mar 27, 2023

  1. fix assumption when resolving dependencies

    When resolving dependencies given a path, we are only interested
    relative files from the current file. We are not interested in the
    dependencies that are listed in your `package.json` and thus in your
    `node_modules` folder.
    
    We made the assumption that your imports have at least 3 characters.
    This sort of makes sense because there will be a `.`, then the OS
    separator like `/` and than a file name. E.g.: `./a` is the minimal
    amount of characters.
    
    This makes sense for `import` statements, but in the case of `require`,
    it is totally valid to write `require('.')`. This will require the
    current `index.{js,ts,mjs,cjs,...}` in the current directory.
    
    Before this change, having a `require('.')` wouldn't crash, but the
    dependency would not be marked as a module dependencies and therefore we
    won't listen for file changes for that dependency.
    RobinMalfait committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    2f3f9b8 View commit details
    Browse the repository at this point in the history
  2. update changelog

    RobinMalfait committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    15501d2 View commit details
    Browse the repository at this point in the history