Open
Description
After the named export pathToGeoJSON
was added it has become hard to use the module in node.js without a bundler (rollup/webpack) as the mixing of default and named exports requires multiple steps to import the default export in barebones node.js. The problem is discussed here rollup/rollup#1961 (comment)
In our case we use both a bundler and node.js worker threads to calculate the path-finder graph in a worker thread, so to reuse the code to construct the path finder we have to do this to be able to handle the import in both scenarios.
import geoJsonPathFinder from "geojson-path-finder";
let GeoJsonPathFinder = geoJsonPathFinder;
if (GeoJsonPathFinder.default) {
GeoJsonPathFinder = GeoJsonPathFinder.default;
}
is it possible to change to all named exports. Or maybe just rewrite the export to have both a default export and named export PathFinder?
Metadata
Metadata
Assignees
Labels
No labels