I am new to using gulp and npm packages so this maybe normal behaviour.
My issue is that I am setting up a new project and have all the packages I need including Browserify when I run gulp
in terminal the files all compile perfectly and minify as expected although there is a small niggling issues I see which is that my sass files in the pre compile folder seem to compile into .css.map
and .css
when I make changes to the css. This is an extra process and creates extra files which I do not like.
Is this normal behaviour?
My tasks is as follows and I have tested it to know its to do with gulp sass:
var src = {
sass: "src/sass/**/*.scss",
js: "src/js/**/*.js",
img: "src/img/*"
};
var output = {
js: "output/js",
css: "output/css",
img: "output/img/",
html: "output/**/*.html",
min_css: "app.min.css",
min_js: "app.min.js"
};
gulp.task('sass', function() {
return gulp.src(src.sass)
.pipe(plumber({
errorHandler: onError
}))
.pipe(sass())
.pipe(prefix('last 2 versions'))
.pipe(concat(output.min_css))
.pipe(gulp.dest(output.css))
.pipe(minify_css())
.pipe(sourcemaps.init())
.pipe(sourcemaps.write())
.pipe(gulp.dest(output.css))
.pipe(browseSync.reload({stream: true}));
});
For more information I have node v5.6.0 and gulp CLI version 1.2.1 gulp Local version 3.9.1.
Maybe there is a weird thing to do with versions of my dev tools?
Any information would be great thanks in advance
Well, you're generating sourcemaps. Check out what you are calling...
.pipe(sourcemaps.init())
.pipe(sourcemaps.write())
So yes, this is normal since you are explicitly calling it. Just delete these pipe
calls to not write sourcemap files.