Answer the question
In order to leave comments, you need to log in
Error while executing "grunt" command?
Hello. I, like all beginners, experience wild difficulties with setting up and installing grunt.js, but at the same time I understand that if I don’t start using it, I won’t budge.
So, I have already installed everything (also with grief in half) and now I am already trying to use the first concat module to combine all files into one, but now I enter grunt and it gives an error:
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected string
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
module.exports = function(grunt) {
// 1. Вся настройка находится здесь
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'assets/js/libs/*.js', // Все JS в папке libs
'assets/js/vendor/*.js' // Конкретный файл
'assets/js/parts/*.js' // Конкретный файл
],
dest: 'assets/js/production.js',
}
}
});
// 3. Тут мы указываем Grunt, что хотим использовать этот плагин
grunt.loadNpmTasks('grunt-contrib-concat');
// 4. Указываем, какие задачи выполняются, когда мы вводим «grunt» в терминале
grunt.registerTask('default', 'concat');
};
{
"name": "loom",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "^1.0.0"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question