coin2html: use webpack to produce the html page #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The simplicity of emitting the html page directly was nice, but the main drawback is that because the typescript code was not modularized it was hard to test. I tried to find a way to avoid a builder, but even with the ES module support in the browser there's no way to import a module inlined within the page, see e.g. https://stackoverflow.com/questions/43817297/inlining-ecmascript-modules-in-html. I read somewhere that it is forbidden by the spec (don't have a reference anymore). There are ways to hack something in, but that defeats the simplicity goal.
So this PR adds webpack configured to spit out a single HTML page with everything built into it, except the imports like d3.js. This allows splitting the monolithic source file into models and views modules. It adds jest config and a first model test, more will follow over time.
Still trying to keep it minimal, just npm, webpack, linters and jest. See package.json for available scripts.