2.1.0 • Published 3 years ago

uhtml-isomorphic v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

uhtml-isomorphic

Actions Status

Isomorphic exports of uhtml

npm install uhtml-isomorphic

Usage

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

2.1.0

3 years ago

2.0.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago