Answer the question
In order to leave comments, you need to log in
How to avoid including JS files in index.html in Angular?
If you follow the tutorials on Angular, then even the simplest application on it already "hammers" index.html with lines like this:
<!-- library scripts -->
<script src="lib/angular/angular.js"></script>
<script src="lib/angular-ui-router/release/angular-ui-router.js"></script>
<script src="lib/angular-loading-bar/build/loading-bar.min.js"></script>
<!-- app scripts -->
<script src="app/app.js"></script>
<!-- services -->
<script src="app/components/auth/AuthService.js"></script>
<!-- controllers -->
<script src="app/components/home/HomeController.js"></script>
<script src="app/components/auth/LoginController.js"></script>
<script src="app/components/navigation/NavigationController.js"></script>
Answer the question
In order to leave comments, you need to log in
На нормальном проекте должна быть инфраструктура с галпом/вебпаком. Если вам самим лень в таком копаться, погуглите готовые генераторы yeoman с angular+webpack/gulp. Жизнь сразу станет проще и веселее.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question