Answer the question
In order to leave comments, you need to log in
How to make gulp-sourcemap work correctly?
For some reason gulp-sourcemaps generates incorrect codemaps.
There is a task to write a task that will process sass sources, add vendor prefixes and compress css in "compact" mode (in sass-compass terminology).
We use gulp-sourcemaps + gulp-compass + gulp-autoprefixer . We write:
gulp.src('src/sass/')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(compass({
style : 'compact',
sourcemap: false,
css : 'build/css/',
sass : 'src/sass/'
}))
.pipe(prefixer())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('build/css/'))
.pipe(connect.reload());
gulp.src('src/sass/')
.pipe(plumber())
.pipe(compass({
style : 'compact',
sourcemap: true,
css : 'build/css/',
sass : 'src/sass/'
}))
.pipe(gulp.dest('build/css/'))
.pipe(connect.reload());
Answer the question
In order to leave comments, you need to log in
Inside the gulp-sourcemaps plugin, there should be plugins that are supported by it (on the plugin page it says: All plugins between sourcemaps.init() and sourcemaps.write() need to have support for gulp-sourcemaps. ). Supported plugins: wiki
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question