Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coin2html: use webpack to produce the html page #26

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

mkobetic
Copy link
Owner

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.

@mkobetic mkobetic force-pushed the webpack branch 3 times, most recently from 91edfc7 to 53b2063 Compare November 28, 2024 23:21
@mkobetic mkobetic merged commit cbf0c8d into master Nov 28, 2024
1 check passed
@mkobetic mkobetic deleted the webpack branch November 28, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant