Using RequireJS to manage dependencies
In the previous section, you learned how to isolate different parts of the code. You also grouped the files by type and component names, which follow a consistent pattern. However, you have not solved one important problem that grows in proportion to the size of the project. To give you a clue about what this problem is, let's see our index.html
file. Look at the part of the <script>
tags section:
<script type="text/javascript" src="js/vendors/jquery.min.js"></script> <script type="text/javascript" src="js/vendors/jquery.mockjax.js"></script> <script type="text/javascript" src="js/vendors/jquery.mockjson.js"></script> <script type="text/javascript" src="js/vendors/icheck.js"></script> <script type="text/javascript" src="js/vendors/bootstrap.min.js"></script> <script type="text/javascript" src="js/vendors/knockout.debug.js"></script> ... ... ... <script type="text/javascript...