Reputation: 299
I'm attempting to use the grunt-email-inliner module and for some reason it doesn't appear to be running. I'm new to grunt, what am I missing? I triple checked the docs.
Here is a link to the plugin: https://github.com/yargalot/Email-Builder
module.exports = function(grunt) {
grunt.initConfig({
emailBuilder: {
test: {
files: [{
expand: true,
cwd: 'web/src/vm-templates',
src: ['*.html'],
dest: 'web/src/result/',
ext: '.vm',
}]
}
},
less: {
development: {
options: {
//compress: true,
//yuicompress: true,
//optimization: 2
},
files: {
// target.css file: source.less file
"WebContent/css/styles.css": "less/styles.less"
}
}
},
watch: {
styles: {
files: ['less/**'], // which files to watch
tasks: ['less'],
options: {
nospawn: true
}
}
}
});
grunt.loadNpmTasks('grunt-email-builder');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less']);
grunt.registerTask('default', ['less', 'watch', 'emailBuilder']);
};
Upvotes: 1
Views: 133
Reputation: 10454
It's not running because you're declaring watch
before you declare emailBuilder
. watch
fires and starts polling for changes before the emailbuilder
can ever get a chance to run. Quadruple check next time.
After reorder:
grunt.registerTask('default', ['less', 'emailBuilder', 'watch']); // correct
Before reorder:
grunt.registerTask('default', ['less', 'watch', 'emailBuilder']); // Incorrect
Also, you're defining a default
task twice:
grunt.registerTask('default', ['less']);
grunt.registerTask('default', ['less', 'watch', 'emailBuilder']);
Drop the first one.
Upvotes: 1