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

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

Open
ento opened this issue Sep 23, 2017 · 0 comments

Comments

@ento
Copy link
Contributor

ento commented Sep 23, 2017

  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)

@ento ento changed the title Specifying a file in modules_directories makes it match anything Specifying a path to a file in modules_directories makes it match with any module name May 12, 2018
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