Closed rickdog closed 9 years ago
Instead of 2 <script>
tags, it's more common to have a single script tag. Otherwise you would need to set globals which cause problems.
So just put:
var h = require('virtual-dom/h')
var elem = h('div', 'whatever')
in a file such as main.js
then you just do:
$ browserify main.js > bundle.js
Then you can put just a single <script>
tag into the page.
ty, mr lambda (cmder.exe?)(LISP?)
I'm making the change to node so I've a bit to learn.
Section "bundling for the browser" explains how to convert for browser inclusion. I'm trying to run virtual-dom directly in browser, so I browserify it:
h.js contains:
the generated bundle.js begins with:
my index.html:
how do I grab the h variable??