Can anyone tell me why I am getting the following error in terminal when running the following grunt.js file?
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: { // Here is where we do our concatenating
dist: {
src: [
'components/js/*.js' // everything in the src js folder
],
dest: 'js/script.js',
}
}
uglify: {
build: {
src: 'js/script.js',
dest: 'js/script.min.js'
}
}
});
//Add all the plugins here
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
//What happens when we type 'grunt' in the terminal
grunt.registerTask('default', ['concat', 'uglify']);
};
The error I get is:
Loading "gruntfile.js" tasks...ERROR
SyntaxError: Unexpected identifier Warning: Task "default" not found. Use --force to continue.
THANKS!
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'components/js/*.js'
],
dest: 'js/script.js',
}
}, // <---- here was a missing comma
uglify: {
build: {
src: 'js/script.js',
dest: 'js/script.min.js'
}
}
});
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
concat:
dist:
src: ["components/js/*.js"]
dest: "js/script.js"
uglify:
build:
src: "js/script.js"
dest: "js/script.min.js"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.registerTask "default", [
"concat"
"uglify"
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With