What is the best way to handle this in AngularJS?
I have an AngularJS app that includes concatenated/minified javascript files, however in my development environment I want to load the non-concatented/non-minified versions of the file. I want this because it is easier to debug the code with non-minified files.
<!-- production -->
<script src="js/all.min.js"></script> <!-- contains all concatenated/minified code -->
<!-- dev -->
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/directives.js"></script>
I am not sure how to do this since in AngularJS I couldn't find a conditional mechanism that is suitable. I had thought about using a directive on the each script tag?
I am using Gulp to concat and uglify the files, but I couldn't find a method to accomplish this with Gulp.
PHP is the server-side language.
Any help will be greatly appreciated.
gusjap :
You could create a \"Source Map\" to go along with the minified javascript file. The source map can then be used when debugging so you can see the original code. If you are using for example UglifyJS 2.0 or Closure Compiler there is an option of creating a source map when you create the minified javascript.\n\nFore more information about source maps and debugging: source maps debugging in Google Chrome ",
2015-08-03T20:48:26