Answer the question
In order to leave comments, you need to log in
Where is the error in gruntfile.js?
Doesn't compile, throws an error, what's the problem here?
module.exports = function(grunt) {
grunt.initConfig({
//Склеивание файлов
concat: {
dist: {
src: [
'js/*.js'
],
dest: 'production/js/script.js',
}
}
//Сжатие
uglify: {
build: {
src: 'production/js/script.js',
dest: 'production/js/script.min.js'
}
}
//Слежение за изменением
watch: {
scripts: {
files: ['js/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
},
}
}
});
//Загрузка модулей
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['concat', 'uglify']);
};
Answer the question
In order to leave comments, you need to log in
You forgot commas:
}, // <-- Запятая
//Сжатие
uglify: {
build: {
src: 'production/js/script.js',
dest: 'production/js/script.min.js'
}
}
and commas after the properties of the object since when are they not placed?
{
concat: {
...},
uglify:
{ ...
},
smth:...
PS I've never worked with grunt, but it immediately caught my eye.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question