marcoslin / angularAMD

Facilitate use of RequireJS in AngularJS
http://marcoslin.github.io/angularAMD
MIT License
734 stars 171 forks source link

How to build angularAMD using grunt uglify and concat? #131

Closed chamviptela closed 9 years ago

chamviptela commented 9 years ago

"grunt-contrib-concat": "^0.4.0", "grunt-contrib-requirejs": "^0.4.4", (also used "grunt-contrib-uglify": "^0.4.0") "angularAMD": "~0.2.1",

I'm able to concat and minify my application js using the above libs (using requirejs to 'uglify' the code). When deploying on to dev server and entering the main.js entry point in index.html, I incur this error: Uncaught Error: Mismatched anonymous define() module: function (app) { app.controller("AdminController", [ "$scope", function($scope) { ... } ]); }

I saw in your example code, you minified the code but didn't concat to one file. Any clue to what maybe causing this error I'm seeing above?

m-gora commented 9 years ago

Why would you concat your js files? RequireJS is dependency management and it's purpose is to load only code that is needed at a certain point. By concatenating you would simply make RequireJS obsolete.