I've built an app using yeoman
's generator-angular
.
I've added my code and commented-out the yeoman auto-generated code for now for reference.
When I run grunt serve
everything works fine, but when i build the code (minify + concat + uglify) the vendor.js
file throws an error saying my main app module is not available, even though all my dependencies are loaded fine and none of them of course is not dependant of my app.
This is how my scripts.js
build block looks like in my index.html
file:
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<!--<script src="scripts/controllers/main.js"></script>-->
<!--<script src="scripts/controllers/about.js"></script>-->
<script src="app.templates.js"></script>
<script src="app.envConfig.js"></script>
<script src="app.js"></script>
<script src="components/auth/auth.srv.js"></script>
<script src="app.routes.js"></script>
<!-- endbuild -->
Note: app.templates.js
& app.envConfig.js
are separated modules I wrote & use, not part of the main app module.
This is my app.js
code:
angular
.module('my-app', [
'ngAnimate',
'ngAria',
'ngCookies',
'ngResource',
'ngTagsInput',
//'ngRoute',
'ngSanitize',
'ngTouch',
'ui.router',
'ui.bootstrap',
'my.templates',
'envConfig'
]);
I came across this answer but it looks like my code is ok.
What am I doing wrong?