I'm trying to use multiple tasks in grunt, one of them is working partialy, and the other is getting erros of not found task
.
This question is based on this one, where I'm using the same gruntfile.js
and the same structure, which is this:
├── Gruntfile.js
└── grunt
├── config
│ ├── conf_sass.js
│ └── conf_home.js
└── register
├── reg_sass.js
└── reg_home.js
With this respective files:
conf_sass.js
module.exports = function(grunt) {
grunt.config.set('sass', {
sass: {
options: {
style:'expanded',
compass: true
},
files: {
'src/css/app.css' : 'src/sass/app.scss'
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'dist/css/app.min.css': 'src/css/app.css'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
};
reg_sass.js
module.exports = function(grunt) {
grunt.registerTask('compSass', ['sass']);
};
conf_home.js
module.exports = function(grunt) {
grunt.config.set('home', {
concat: {
dist : {
src: 'src/.../home/*.js',
dest: 'src/.../concat_home.js'
}
},
ngAnnotate: {
options: {
add: true
},
dist: {
files: {
'src/.../concat_home.js': 'src/.../concat_home.js'
}
}
},
uglify: {
dist: {
src: 'src/.../concat_home.js',
dest: 'app/.../home.min.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-ng-annotate');
};
reg_home.js
module.exports = function(grunt) {
grunt.registerTask('compHome', ['home']);
};
The problem is:
The sass process, runs everything without erros, but doesn't execute the css minify part, even with no errors at all.
The home process, return an error
Warning: task 'home' not found
What's wrong with it? I have all the modules installed because they were all working before moving to this new structure.