Skip to content

module-fs loader #3

@tolmasky

Description

@tolmasky
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions