I would like to use the mini-build as an es-module. In other words something like this:
import {h, app} from 'https://unpkg.com/hyperapp'
import htm from 'https://unpkg.com/htm/mini'
const html = htm.bind(h)
What I wrote above doesn't work unfortunately. Is there something else, similar I could write?
The best I've been able to come up with is this:
import {h, app} from 'https://unpkg.com/hyperapp'
import 'https://unpkg.com/htm/mini' //puts `htm` in global scope
const html = htm.bind(h)
... but I'd prefer not to put things in the global scope.
Strictly speaking, it's not the smaller size I'm after with the mini-version, but the fact that it doesn't do the caching. So... if there isn't a way to import the mini version as an es-module, please consider this a feature request to be able to turn off caching in regular htm.
(Suggestion: const html = htm.bind(h, {caching: false}))
I would like to use the mini-build as an es-module. In other words something like this:
What I wrote above doesn't work unfortunately. Is there something else, similar I could write?
The best I've been able to come up with is this:
... but I'd prefer not to put things in the global scope.
Strictly speaking, it's not the smaller size I'm after with the mini-version, but the fact that it doesn't do the caching. So... if there isn't a way to import the mini version as an es-module, please consider this a feature request to be able to turn off caching in regular htm.
(Suggestion:
const html = htm.bind(h, {caching: false})
)Thanks!