hyperapp + parcel


インストール

npm init -y && npm i hyperapp parcel-bundler babel-plugin-transform-react-jsx babel-preset-env

package.json

{
...
  "scripts": {
    "start": "parcel index.html",
    "build": "parcel build index.html --public-url ./"
  }
...
}

.babelrc

{
  "presets": ["env"],
  "plugins": [
    [
      "transform-react-jsx",
      {
        "pragma": "h"
      }
    ]
  ]
}

index.js

import { h, app } from 'hyperapp'
const view = () =>
  <div>
    hello hyperapp
  </div>
app({}, {}, view, document.body)

index.html

<html>
  <body>
    <script src="./index.js"></script>
  </body>
</html>

参考

Hyperapp + Parcel = 😎