Skip to content

Specifying a path to a file in modules_directories makes it match with any module name #18

@ento

Description

@ento
  1. Clone this gist. Its jetpack.json is set up like so (note that vendor.js is a file:
  "modules_directories": [
    "./",
    "./vendor.js"
  ],
  1. Follow the README and run jetpack as specified.

Expected: fail with: I had troubles finding "non-existent-module".

Actual: var module = require('non-existent-module') gets compiled as:

var module = jetpackRequire(vendor_js_js, "vendor_js_js")

I guess it's from

<|> moduleExistsInBase "" require

(but probably the fix is to exit early if modules_directories contain a path pointing at a file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions