I am using grunt to club various javascript files and minify them all. e.g
module.exports = function (grunt) {
grunt.initConfig({
uglify: {
build: {
src: ['js/jquery-1.7.min.js','js/common.js','js/drop_down.js', 'js/main_jquery.js', 'js/tooltip.js', 'js/html5shiv.js','js/MathJax/MathJax.js','js/angular-1.2.15.min.js','js/ui-bootstrap-tpls-0.9.0.js'],
dest: 'js/output.min.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
On using output.js
in place of src files, I am getting surprising javascript errors.
e.g.This error results from the $injector being unable to resolve a required dependency. To fix this, make sure the dependency is defined and spelled correctly.
I am curious to know how does uglify
deal with variables with same name in two files. What could all be the reason for javascript errors?