It then set window.client to an object that "exposed" each function as a property. That module's file defined a few functions, like getTimers(). For instance, the time tracking app had a Client module. ![]() For our purposes, the most pressing limitation is the lack of support for JavaScript modules. serve: run the server http-server and serve the contents of directory build/. wpw: webpack watches the files and only compiles what changes, incrementally. You can begin writing React components in ES6 with little setup. wp: run webpack once, compile everything. We began with this setup strategy because it's the simplest. If you need a refresher on our setup strategy so far, we detail it in Chapter 1. ![]() With this setup we've been able to load in any ES6 JavaScript file we wanted in index.html, specifying that its type is text/babel:īabel would handle the loading of the file, transpiling our ES6 JavaScript to browser-ready ES5 JavaScript. In most of our earlier projects, we loaded React with script tags in our apps' index.html files:īecause we've been using ES6, we've also been loading the Babel library with script tags:
0 Comments
Leave a Reply. |