@pika/web
だったのが snowpack
になったっぽいshell
y add preact
y add -D snowpack
snowpack
y add -D serve
serve
open http://localhost:5000
index.html
<div id="app"></div>
<script type="module" src="/src/app.js"></script>
src/app.js
import { h, Component, render } from '/web_modules/preact.js'
const app = h('div', null, 'Helloooo')
render(app, document.getElementById('app'))
shell
y add htm
snowpack
src/app.js
import { h, Component, render } from '/web_modules/preact.js'
import htm from '/web_modules/htm.js'
const html = htm.bind(h)
const app = html`
<div>yo yo</div>
`
render(app, document.getElementById('app'))
shell
y add csz
snowpack
src/app.js
import { h, Component, render } from '/web_modules/preact.js'
import htm from '/web_modules/htm.js'
import css from '/web_modules/csz.js'
const html = htm.bind(h)
const style = css`
color: #f00;
`
const app = html`
<div class="${style}">yo yo</div>
`
render(app, document.getElementById('app'))