uhtml-isomorphic

2.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i uhtml-isomorphic

Weekly Downloads

37

Version

2.1.0

License

MIT

Unpacked Size

12.8 kB

Total Files

17

Last publish

Collaborators

  • bret