elliotstokes / gpx-parse

GPX parser
MIT License
44 stars 40 forks source link

Bower Usage #14

Closed cspeer closed 8 years ago

cspeer commented 8 years ago

Hi,

when I use the lib via bower, there are no errors thrown, but the gpxParse is not available. I'm not sure but I think if the index.js does not actually load all modules the bower.json should point to a compiled version for the browser in its main attribute.

Thanks, Chris

elliotstokes commented 8 years ago

Ah ok the index.js is for use within node. If you are using it in the browser you need to use the file within the dist folder.

Ill change bower to point to that instead.

elliotstokes commented 8 years ago

Ok I hadnt drafted a release so bower was getting a really old version (not published anything to bower before. Sorry). if you download again from bower you should now get the dist folder. Let me know how you get on with that.

cspeer commented 8 years ago

Well, now I get the following error in the browser: Uncaught ReferenceError: module is not defined from this line: module.exports = process.env.GPXPARSE_COV ? require('./lib-cov/gpx-parse') : require('./lib/gpx-parse');

cspeer commented 8 years ago

Maybe you are right and I really shouldn't handle the parsing in the user's browser though

elliotstokes commented 8 years ago

are you using the file in the dist folder? dont use the index.js on the client.

cspeer commented 8 years ago

Yeah, the bower.json still points to index.js in "main"

On Wed, Feb 10, 2016 at 12:29 PM Elliot Stokes notifications@github.com wrote:

are you using the file in the dist folder? dont use the index.js on the client.

— Reply to this email directly or view it on GitHub https://github.com/elliotstokes/gpx-parse/issues/14#issuecomment-182324731 .

elliotstokes commented 8 years ago

i have pointed it to the file in dist now. See how you get on with that.

cspeer commented 8 years ago

Whoop whoop, that works. Thanks a lot, Elliot!

elliotstokes commented 8 years ago

thanks. Any other problems let me know - it's nice to know people are getting some use out of it!

cspeer commented 8 years ago

oh I'm getting a lot of use out of it. I was so happy when I discovered your lib! Saves me so much time.

On Wed, Feb 10, 2016 at 12:55 PM Elliot Stokes notifications@github.com wrote:

thanks. Any other problems let me know - it's nice to know people are getting some use out of it!

— Reply to this email directly or view it on GitHub https://github.com/elliotstokes/gpx-parse/issues/14#issuecomment-182332378 .