2.1.0 • Published 3 years ago
uhtml-isomorphic v2.1.0
uhtml-isomorphic
Isomorphic exports of uhtml
npm install uhtml-isomorphicUsage
Use uhtml or uhtml-ssr from a single import identifier depending on then environment you are running.
import {render, html, svg} from 'uhtml-isomorphic';
// const {render, html, svg} = require('uhtml');
render(document.body, html`<h1>Hello 👋 µhtml</h1>`);How
While @webreflection recomends require-overrides in the offical documentation, that requires special flags or transforms to work.
uhtml-isomorphic works by utilizing environment specific exports fields so that you can have dependency injection at the built-in module resolver layer.
It supports the following export fields:
main(cjs node)browser(cjs browser)exports.import(esm node)exports.reqire(cjs node)exports.browser(esm browser)
License
MIT