Below is the content of my Gruntfile.js:
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
uglify: {
start: {
files: {
'js/script.min.js': ['js/script.js'],
}
}
},
imagemin: {
build: {
options: {
optimizationLevel: 3
},
files: [{
expand: true,
src: ['img/sprite_svg/*.svg'],
}]
}
},
svgstore: {
options: {
includeTitleElement: false,
svg: {
style: 'display:none',
},
cleanup: [
'fill',
],
},
default : {
files: {
'img/sprite.svg': ['img/sprite_svg/*.svg'],
},
},
},
watch: {
livereload: {
options: { livereload: true },
files: ['build/**/*'],
},
scripts: {
files: ['js/script.js'],
tasks: ['js'],
options: {
spawn: false
},
},
images: {
files: [
'img/sprite_svg/*.svg'
],
tasks: ['img'],
options: {
spawn: false
},
},
html: {
files: ['./index.html'],
// tasks: ['html'],
options: {
spawn: false
},
},
},
browserSync: {
dev: {
bsFiles: {
src : [
'img/sprite.svg',
'./index.html',
]
},
options: {
watchTask: true,
server: {
baseDir: "./",
},
startPath: "index.html",
ghostMode: {
clicks: true,
forms: true,
scroll: false
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('default', [
'js',
'img',
'browserSync',
'watch'
]);
grunt.registerTask('js', [
'uglify'
]);
grunt.registerTask('img', [
'imagemin',
'svgstore'
]);
};
I have installed both the uglify and imagemin npm packages, but I am encountering an error: Warning: Task "uglify" not found.
This issue arose after adding svgstore to the configuration, and I suspect it may be a syntax error. As a beginner in using Grunt, I'm unsure about what is causing this problem. Any assistance or guidance would be highly appreciated.