Currently, I am utilizing the "grunt-closure-tools" tool.
Initially, minifying a simple JS file was successful without any issues. However, encountering an exception arose when attempting to minify either the AngularJS or Bootstrap libraries:
Error: Command failed: build\lib\angular.js:9040 WARNING - Keywords and reserved words are not allowed as unquoted property names in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option.
build\lib\angular.js:256: ERROR - Parse error. identifier is a reserved word */
build\lib\angular.js:258: ERROR - Parse error. identifier is a reserved word if (isNaN(msie)) {
...................
Here is a snippet from my Gruntfile.js:
module.exports = function(grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
closureCompiler: {
options: {
compilerFile: 'lib/google-closure-tools/compiler.jar'
},
minify: {
files: [
{
expand: true,
src: ['build/**/*.js', '!build/**/*.min.js'],
ext: '.min.js'
}
]
}
}
});
grunt.loadNpmTasks('grunt-closure-tools');
grunt.registerTask('closure', ['closureCompiler']);
};
Any assistance on this matter would be greatly appreciated.