I also made the .ts refactor. Sorry if it looks like a deep rewrite, I also added a prettier configuration.
Main Changes
This refactor does also include source maps.
You won't even need two separate config files for webpack, nor a different node version.
Both geonames.js and geonames.min.js will work on both browser and node.
I also excluded axios from the bundle using externals, so the user will need to include it by him/herself (which is correct, I think).
Tests were tuned accordingly
Browser test requires username as querystring param, e.g., if you are serving from localhost:3000:
http://localhost:3000/spec/test-browser.html?username=demo
I added prettier in order to get automatic and uniform formatting with vscode
So now the minified version (which works on both node and browser) is slightly bigger in size than previous node version, but that may be due to umd an ts transpiling boilerplate. But it's still 1/4 of the prevous browser version! :)
Hi @kinotto ,
I also made the .ts refactor. Sorry if it looks like a deep rewrite, I also added a prettier configuration.
Main Changes
http://localhost:3000/spec/test-browser.html?username=demo
Generated bundle sizes
Comparison of bundle sizes
Before
Now
So now the minified version (which works on both node and browser) is slightly bigger in size than previous node version, but that may be due to umd an ts transpiling boilerplate. But it's still 1/4 of the prevous browser version! :)