Reputation: 145
I have a problem with split my gulpfile using require-dir module.. In ./gulp directory I have a gulp.js file with task:
var gulp = require('gulp')
var sass = require('gulp-sass')
gulp.task('sass', function() {
return gulp.src('./styles/sass/**/*.sass')
.pipe(sass())
.pipe(gulp.dest('./styles/css/'))
});
This is my gulpfile.js :
var gulp = require('gulp');
var requireDir = require('require-dir');
requireDir('./gulp');
gulp.task('watch', function() {
gulp.watch('frontend/styles/sass/**/*.sass', ['sass']);
});
The main problem that all working correctly without errors in console but task dont make nothing (sass dont compile to css)
console.log:
[14:37:31] Using gulpfile ~\Desktop\pokemongo\app\development\gulpfile.js
[14:37:32] Starting 'watch'...
[14:37:32] Finished 'watch' after 31 ms
[14:38:05] Starting 'sass'...
[14:38:05] Finished 'sass' after 12 ms
If I put code in single gulpfile all working perfect..
Upvotes: 0
Views: 895
Reputation: 145
I have another way to gulpfile split but I got same problem...
my main gulpfile:
var sass = require('gulp-sass');
var gulp = require('gulp');
require('./gulp/gulpcss.js')(gulp, sass);
gulp.task('watch', function() {
gulp.watch('./frontend/styles/sass/**/*.sass', ['sass'])
});
my gulpcss:
module.exports = function (gulp, sass) {
gulp.task('sass', function(){
return gulp.src('../frontend/styles/sass/**/*.sass')
.pipe(sass())
.pipe(gulp.dest('../frontend/styles/css/'))
});
};
console log ->
[14:37:31] Using gulpfile ~\Desktop\pokemongo\app\development\gulpfile.js
[14:37:32] Starting 'watch'...
[14:37:32] Finished 'watch' after 31 ms
[14:38:05] Starting 'sass'...
[14:38:05] Finished 'sass' after 12 ms
The main problem that all working correctly without errors in console but task dont make nothing again. (sass dont compile to css)
If I put code in single gulpfile all working perfect..
Upvotes: 0