geodesy icon indicating copy to clipboard operation
geodesy copied to clipboard

Webpack bundle

Open mohmmad1024 opened this issue 5 years ago • 5 comments

Hi @chrisveness,

I did a simple webpack bundle configuration for my clients' needs with older browsers. So I needed the ES5 support in my application.

What I did is creating a configuration file webpack.config.js and bundle.js to customize the naming under the global variable geodesy in the browser. moreover, added the following development dependencies babel-core babel-loader@7 webpack webpack-cli

The future is not ES5 or older so the I did not make any changes to the library. I just added my work independently. I hope this helps and I am thankful for your work.

mohmmad1024 avatar Apr 28 '19 20:04 mohmmad1024

Any chance of resolving the conflicts? Having an ie compatible version would help with a project of mine where ie is a desired legacy browser to support.

arthur-clifford avatar Sep 17 '19 07:09 arthur-clifford

Apologies for not responding earlier.

If you have to cater for older browsers, perhaps you could use v1.1.3, which is ES5.

I have no experience with bundlers myself, and don't really want to get pulled into catering for not just webpack, but potentially rollup, parcel, and maybe others...

chrisveness avatar Sep 17 '19 14:09 chrisveness

@chrisveness Just wondering if you would reconsider, or accept a clean PR for webpack, it would also make it easier to use with the other bundlers. Related to https://github.com/chrisveness/geodesy/issues/90

ivanoats avatar Dec 01 '20 02:12 ivanoats

I've not used webpack, but looking at webpack.js.org/guides/ecma-script-modules, it seems that webpack can now handle ES Modules natively? – "by default webpack will automatically detect whether a file is an ESM or a different module system".

Otherwise, not being a webpack user, I don't know how it would handle the main/multiple entry points issue highlighted in #90. The ESM loader handles all the inter-dependencies illustrated in www.movable-type.co.uk/scripts/geodesy-library.html#class-dependencies.

Mostly, though, it's not just webpack – I'm no more familiar with alternatives such as browserify, rollup, parcel, etc, which would probably have equal claim to configuration being included.

chrisveness avatar Dec 01 '20 19:12 chrisveness

I have a fork of this PR and it's pretty out of date and still needs work, so we should probably close this PR. It's probably better to tackle it from the angle Zack was proposing in #90 and if/when he is available again I can ask him, or figure it out.

ivanoats avatar Dec 01 '20 19:12 ivanoats