elliotstokes / gpx-parse

GPX parser
MIT License
44 stars 40 forks source link

Cannot run with module bundler #29

Open cloudlena opened 6 years ago

cloudlena commented 6 years ago

I would like to use this library with a create-react-app application. However, when I import it, I get the following error:

Module not found: Error: Can't resolve './lib-cov/gpx-parse' in '/Users/me/js/jespr-web/node_modules/gpx-parse'

When I make the following change to index.js, it works:

- module.exports = process.env.GPXPARSE_COV ? require('./lib-cov/gpx-parse') : require('./lib/gpx-parse');
+ module.exports = require('./lib/gpx-parse');

It seems like the require statement is evaluated even then process.env.GPXPARSE_COV is false. Can we remove this check?