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

Better handling of package.json main configuration #190

Closed
Fatme opened this issue Aug 18, 2015 · 2 comments
Closed

Better handling of package.json main configuration #190

Fatme opened this issue Aug 18, 2015 · 2 comments

Comments

@Fatme
Copy link

Fatme commented Aug 18, 2015

Moved from NativeScript/nativescript-cli#670

@jlooper and I have run across a few different npm modules that have a "main" of "index" in their package.json, instead of "index.js"—for example https://github.com/Sembiance/email-validator and https://github.com/snoj/email-validation.

This difference means that using one of these modules requires you to do:

var validator = require("email-validator/index");

instead of

var validator = require("email-validator");

Can the NativeScript CLI be changed to assume the .js suffix when it is not present? Furthermore, I'd like the CLI to support modules that do not have a "main" in their package.json at all. In these cases the NativeScript CLI should just use that module's index.js (if present).

Thanks.

@Plamen5kov
Copy link
Contributor

We already support index.js as "last resort"

Plamen5kov added a commit that referenced this issue Sep 8, 2015
@Plamen5kov
Copy link
Contributor

now in package.json in attribute "main", it doesn't matter if you didn't specify the ".js" extension, because it will be added if missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants