gpx-parse icon indicating copy to clipboard operation
gpx-parse copied to clipboard

Cannot run with module bundler

Open cloudlena opened this issue 6 years ago • 0 comments

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?

cloudlena avatar May 29 '18 09:05 cloudlena