While reliance on globals is probably okay with <script> usage, in a scenario with a bundler it is not necessary and undesired to have any globals. How about allowing something like this?
import htmx from 'htmx.org';
import idiomorph from 'idiomorph/dist/idiomorph-ext-bundler.min.js';
htmx.defineExtension('morph', idiomorph);
The htmx init code here relies on a
htmx
global: https://github.com/bigskysoftware/idiomorph/blob/8e40c42cc573609eb6863e72fa3403574974dd7d/src/idiomorph-htmx.js#L12While reliance on globals is probably okay with
<script>
usage, in a scenario with a bundler it is not necessary and undesired to have any globals. How about allowing something like this?Related: https://github.com/bigskysoftware/htmx/issues/1690