Skip to content

How to handle paths outside of package.json's directory #5

Description

@mk-pmb
  "browser": {
    "./../../limits.json": "./overrides/limits.json",
    "/etc/users.json": "./override/etc_users.json"
  }

The first one even complies with the wishful thinking that

All paths for browser fields are relative to the package.json file location

I can make up a dozen of cases where it would be really useful if some bundlers accept above config, but nevertheless I propose that:

Bundlers MUST ignore overrides that:

  • would apply to parent directories of the package.json that sets them (nope, that could leak information about file system structure)
  • contain upwards path components, e.g. ...
  • contain absolute or network paths, e.g. start with a slash (linux/win), backslash (win), drive letter (win), UNC path (win)
  • contain characters below U+0020

You might wish to include even more Unicode ranges, but they'd probably be in a region where we'd have to care about the differemces between UTF-8 and UCS-2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions