gruntjs - Grunt Watch - Verifiying property -
i'm attempting seperate grunt file can process 2 separate chunks of code, seems work apart watch task.
i following error loops out until exceeds call stack
waiting...verifying property watch.app.files exists in config...error >> unable process task. warning: required config property "watch.app.files" missing.
it seems doesn't watch task being split two. i've around , doesn't seem issue other people.
my gruntfile looks this:
module.exports = function(grunt) { // 1. configuration goes here grunt.initconfig({ pkg: grunt.file.readjson('package.json'), concat: { app: { src: [ 'themes/site_themes/app/scripts/build/libs/!(html5shiv|respond).js', 'themes/site_themes/app/scripts/build/modules/*.js' ], dest: 'themes/site_themes/app/scripts/production/app.min.js' }, marketing: { src: [ 'themes/site_themes/marketing/scripts/build/libs/!(html5shiv|respond).js', 'themes/site_themes/marketing/scripts/build/modules/*.js' ], dest: 'themes/site_themes/marketing/scripts/production/app.min.js' } }, uglify: { app: { files: { 'themes/site_themes/app/scripts/production/app.min.js': ['themes/site_themes/app/scripts/production/app.min.js'], 'themes/site_themes/app/scripts/production/html5shiv.min.js': ['themes/site_themes/app/scripts/build/libs/html5shiv.js'], 'themes/site_themes/app/scripts/production/respond.min.js': ['themes/site_themes/app/scripts/build/libs/respond.js'], } }, marketing: { files: { 'themes/site_themes/marketing/scripts/production/app.min.js': ['themes/site_themes/marketing/scripts/production/app.min.js'], 'themes/site_themes/marketing/scripts/production/html5shiv.min.js': ['themes/site_themes/marketing/scripts/build/libs/html5shiv.js'], 'themes/site_themes/marketing/scripts/production/respond.min.js': ['themes/site_themes/marketing/scripts/build/libs/respond.js'], } } }, jshint: { app: { all: ['themes/site_themes/app/scripts/build/modules/!(analytics).js', 'themes/site_themes/app/scripts/build/app.js'], }, marketing: { all: ['themes/site_themes/marketing/scripts/build/modules/!(analytics).js', 'themes/site_themes/marketing/scripts/build/app.js'], } }, sass: { app: { options: { style: 'compressed' }, files: { 'themes/site_themes/app/styles/production/style.min.css':'themes/site_themes/app/styles/build/style.scss' } }, marketing: { options: { style: 'compressed' }, files: { 'themes/site_themes/marketing/styles/production/style.min.css':'themes/site_themes/marketing/styles/build/style.scss' } } }, autoprefixer: { options: { browsers: ['last 2 versions', 'ie >= 8'] }, app: { no_dest: { src: 'themes/site_themes/app/styles/production/style.min.css', } }, marketing: { no_dest: { src: 'themes/site_themes/marketing/styles/production/style.min.css', } } }, watch: { app: { jshint: { files: ['themes/site_themes/app/scripts/build/modules/!(analytics).js', 'themes/site_themes/app/scripts/build/app.js'], tasks: 'jshint:app' }, scripts: { files: ['themes/site_themes/app/scripts/build/*/*.js'], tasks: ['concat:app', 'uglify:app'], options: { spawn: false, }, }, css: { files: ['themes/site_themes/app/styles/build/*.scss', 'themes/site_themes/app/styles/build/inuit/*/*.scss', 'themes/site_themes/app/styles/build/theme/*/*.scss'], tasks: ['sass:app', 'autoprefixer:app'], options: { livereload: true, spawn: false, } } }, marketing: { jshint: { files: ['themes/site_themes/marketing/scripts/build/modules/!(analytics).js', 'themes/site_themes/marketing/scripts/build/app.js'], tasks: 'jshint:marketing' }, scripts: { files: ['themes/site_themes/marketing/scripts/build/*/*.js'], tasks: ['concat:marketing', 'uglify:marketing'], options: { spawn: false, }, }, css: { files: ['themes/site_themes/marketing/styles/build/*.scss', 'themes/site_themes/marketing/styles/build/inuit/*/*.scss', 'themes/site_themes/marketing/styles/build/theme/*/*.scss'], tasks: ['sass:marketing', 'autoprefixer:marketing'], options: { livereload: true, spawn: false, } } } } }); // 3. tell grunt plan use plug-in. grunt.loadnpmtasks('grunt-contrib-concat'); grunt.loadnpmtasks('grunt-contrib-uglify'); grunt.loadnpmtasks('grunt-contrib-sass'); grunt.loadnpmtasks('grunt-autoprefixer'); grunt.loadnpmtasks('grunt-contrib-jshint'); grunt.loadnpmtasks('grunt-contrib-watch'); // 4. tell grunt when type "grunt" terminal. grunt.registertask('default', ['concat:app', 'uglify:app', 'jshint:app', 'sass:app', 'autoprefixer:app', 'watch:app']); grunt.registertask('marketing', ['concat:marketing', 'uglify:marketing', 'jshint:marketing', 'sass:marketing', 'autoprefixer:marketing', 'watch:marketing']); };
just found this. looks nested targets aren't supported watch.
i'll try find way to , post if do.
Comments
Post a Comment