I'm trying to add a custom task in a salsjs application.
This is what I've done so far:
- Added a new file in the task/config directory named cssminTemplates.js
- Modify the default.js file in the task/registerd directory.
My cssminTemplates.js is basically a copy of the cssmin.js standard file:
module.exports = function(grunt) {
grunt.config.set('cssminTemplates', {
dist: {
src: ['asset/templates/above_the_fold.css'],
dest: 'asset/templates/above_the_fold.min.css'
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
};
default.js file as been modified as follow:
module.exports = function (grunt) {
grunt.registerTask('default', [
'compileAssets',
'linkAssets',
'cssminTemplates',
'watch']);
};
But when I start the app with sails lift command I got this error:
Warning: Task "cssminTemplates" not found.
I try to change the 'cssminTemplates' with 'cssmin' and I've got no errors.