Grab our runtime dependencies
We’ll need to grab Knockout itself, as well as something called RequireJS. RequireJS is a library that enables us to load modules at runtime asynchronously.
There are several ways we can go about this:
- Download the files manually and host them.
- Download the files through a package manager like Bower and host them.
- Use a Content Delivery Network (CDN) to host both files.
We’ll keep it simple and go with the first option, but Knockout’s documentation has details on using a CDN, and more libraries like RequireJS can be searched for on cdnjs.
Let’s create an externals
folder in the root of our project.
1 | mkdir externals |
Now download Knockout and download RequireJS into that folder. The latest and minified versions of the files should work just fine.
Please login to continue.