Debug with min files in AngularJS

4

I created a task in Grunt to automatically concat and uglify in my files .js of the Angular to improve the performance and also not to be inserting a new file every time I create a controller, for example. However, with that, the errors in the console became obviously incoherent. So I would like to know if there is any way to create a .map (as I already do in my .min of Bootstrap with LESS ) or something like that to make it easier for debug .

    
asked by anonymous 17.01.2017 / 15:00

1 answer

4

You do not need concat and uglify for development time - you're actually adding overhead when concatenating and minifying all content after each change.

If you're using traditional Grunt tasks notation, you probably have a build called. Remove the uglify step. something like this:

grunt.registerTask("build", [
    "concat:all",
    "concat_css:all",
    "bower_concat:all"
]);

Add an additional task to prepare the project for production mode:

grunt.registerTask("build-dist", [
    "concat:all",
    "concat_css:all",
    "cssmin:all",
    "bower_concat:all",
    "uglify:all"
]);

Run the task build-dist only when you are ready to submit the project for production.

    
17.01.2017 / 16:06