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

module-fs loader #3

Open
tolmasky opened this issue Nov 19, 2022 · 0 comments
Open

module-fs loader #3

tolmasky opened this issue Nov 19, 2022 · 0 comments

Comments

@tolmasky
Copy link

tolmasky commented Nov 19, 2022

  1. Only needs request(), given a bar import ("x") (and a relative file?), it will check /modules/timestamps[x]/x...
  2. If the algorithm is check loader, if failed (404), fall back to next, then we simply have to put our loader at the end of the list.
  3. It will first check node_modules/x (and possibly correctly find it in the case of bundled dependencies, or even resolved dependencies), and keep going upwards. Again, it's "base" path will already be in a timestamp path if it is a dependency, and if it is top level, it will immediately fail since there is nothing in node_modules.

So, an import from the top level, immediately fails on the normal loader, then it falls into our loader, which redirects to the timestamped path, at which point it uses the normal node absolute path file loader.

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

No branches or pull requests

1 participant