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

add: index.js as "main" entrypoint In package.json. #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sosukeinu
Copy link

I recently ran into an issue with Node-Red where I was unable to install your package through NPM automatically in a Function Node, because it lacked the standard "main" entrypoint in the package.json file.

By doing so there are, of course, trade-offs, but I needed to do so to get it to work with my specific use case. The change in usage would only be in the way classes were imported into projects.

Before:

import LatLon, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/latlon-ellipsoidal-vincenty.js'; // browser
import LatLon, { Dms } from 'geodesy/latlon-ellipsoidal-vincenty.js'; // Node.js

After:

import LatLon, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/latlon-ellipsoidal-vincenty.js';  //OR
import LatLonEllipsoidal_Vincenty, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/index.js'; // browser
import LatLonEllipsoidal_Vincenty, { Dms } from 'geodesy';  //OR
import 'geodesy'; 

const point = new geodesy.LatLonEllipsoidal(1,1,0); // Node.js

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

Successfully merging this pull request may close these issues.

1 participant