javascript - Loading "Gruntfile.js" tasks...ERROR while running `grunt` -
i'm new grunt world.
after installing grunt-cli, , dependencies, here : gruntfile.js
/* grunt installation: ------------------- npm install -g grunt-cli npm install -g grunt-init npm init (creates `package.json` file) project dependencies: --------------------- npm install grunt --save-dev npm install grunt-contrib-concat --save-dev npm install grunt-contrib-watch --save-dev example usage: -------------- grunt -v grunt release -v */ module.exports = function(grunt) { "use strict"; grunt.initconfig({ concat: { js: { src: ['js/bootstrap.min.js', 'js/jquery-1.10.2.min.js'], dest: 'build/js/scripts.js' }, css: { src: ['css/bootstrap.min.css', 'css/font-awesome.min.css'], dest: 'build/css/styles.css' } }, watch: { js: { files: ['js/**/*.js'], task: ['concat:js'] }, css: { files: ['css/**/*.css'], task: ['concat:css'] } } }); grunt.loadnpmtasks('grunt-contrib-concat'); grunt.loadnpmtasksnpmtasks('grunt-contrib-watch'); grunt.registertask('default', ['concat', 'watch']); }; result
now testing part, tried run grunt, kept getting :
loading "gruntfile.js" tasks...error >> typeerror: undefined not function warning: task "default" not found. use --force continue. aborted due warnings. can please tell me did wrong here ?
it looks default target not being created due typo. try renaming
grunt.loadnpmtasksnpmtasks('grunt-contrib-watch'); to
grunt.loadnpmtasks('grunt-contrib-watch');
Comments
Post a Comment