March 2019
Intermediate to advanced
208 pages
5h 11m
English
If we try to use node to run the compiled code, it won’t work. Since the program isn’t running in a web context, it won’t be able to find the Calculate button. We have to use a bundler to make our code and HTML web-ready.
One part of our workflow hasn’t changed—we use npm run build to compile the program:
| | > npm run build |
| | |
| | shirts@0.1.0 build /home/you/code/webpage/shirts |
| | bsb -make-world |
| | |
| | [156/156] Building src/canvas/Canvas2dRe.mlast.d |
| | [78/78] Building src/Webapi.cmj |
| | ninja: Entering directory `lib/bs' |
| | [3/3] Building src/WebShirts.mlast.d |
| | [1/1] Building src/WebShirts-Shirts.cmj |
Here’s where we depart from our previous workflow—we use parcel to bundle our files:
| | > parcel build |
Read now
Unlock full access