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

add register.js to sideEffects #118

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

wrapperup
Copy link

@wrapperup wrapperup commented Feb 3, 2024

When bundling and using the @kitajs/html/register module, it is removed during tree shaking. This affects Vite and esbuild (and maybe others, haven't tested), which would cause the following error to happen at runtime:

ReferenceError: Html is not defined

Adding register.js as a side effect will prevent bundlers from removing the module entirely when used, since it isn't a pure module.

Fixes #89 as well.

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (97fa060) 98.74% compared to head (cfcfa21) 98.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #118   +/-   ##
=======================================
  Coverage   98.74%   98.74%           
=======================================
  Files           4        4           
  Lines        1032     1032           
=======================================
  Hits         1019     1019           
  Misses         13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arthurfiorette arthurfiorette merged commit cbb29c9 into kitajs:master Feb 4, 2024
4 checks passed
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.

Vitejs - ReferenceError: Html is not defined (Import Html on every file?)
2 participants