bigskysoftware / bigskysoftware/_hyperscript

Doesn't work when bundling

Open
#162 8 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Make a new folder and run these four commands to set up a basic bundle with [esbuild](https://esbuild.github.io/) (webpack competitor):

```
npm install htmx.org hyperscript.org esbuild
echo 'require("htmx.org/dist/htmx.js"); require("hyperscript.org/dist/_hyperscript.js");' > app.js
npm exec -- esbuild app.js --bundle --outfile=bundle.js
echo '' > index.html
```

... and then open `index.html` in the browser. htmx successfully loads and works, but hyperscript breaks with a couple of these errors:

```
Uncaught ReferenceError: _hyperscript is not defined
```

It looks like hyperscript's module loading wrapper is only applied to the runtime, and not the individual commands.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.