I use Preact without build tools. (P)react is fully capable of running in a browser by itself with vanilla JS code. To use JSX, though, you need a transpiler, fall back to Hyperscript, or use something like htm.
Embed a <script> tag pointing to ./node_modules/preact/dist/preact.umd.js in my app (I use UMD). Now, I can access preact as a global variable.
Alternatively, use ./node_modules/preact/dist/preact.module.js if you prefer ES6 import.
If you want, preact/compat and preact/hooks are available as separate JS files in ./node_modules/preact/compat/dist/ and ./node_modules/preact/hooks/dist/.
5
u/lifeeraser Sep 23 '19
I use Preact without build tools. (P)react is fully capable of running in a browser by itself with vanilla JS code. To use JSX, though, you need a transpiler, fall back to Hyperscript, or use something like htm.