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
FIX #46: Fallback to index.js if no main attribute in package.json #78
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -118,9 +118,16 @@ module Node: MODULE_SYSTEM = struct | |||
let rec f = function | |||
| "main" :: file :: _ -> | |||
let path = Files_js.normalize_path (Filename.dirname package) file in | |||
path_if_exists path | |||
if Sys.file_exists path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so you want to try foo.js when you have main: foo in package.json.
Could you please rewrite this case to conform to the pattern used elsewhere in this file, which would be something like:
seq
(fun () -> path_if_exists path)
(fun () -> seqf
(fun ext -> path_if_exists (path ^ ext)) (* try all extensions *)
Files_js.flow_extensions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I try to, but I have to learn a little more OCaml before. 😄
IMHO this is ready for merging, isn't it? |
You where right, it was not neccessary. I'll removed this check. |
FIX #46: Fallback to index.js if no main attribute in package.json
No description provided.