Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with gulp-sourcemaps and gulp-autoprefixer #108

Open
evgeniy-vashchuk opened this issue Oct 6, 2018 · 0 comments
Open

Problem with gulp-sourcemaps and gulp-autoprefixer #108

evgeniy-vashchuk opened this issue Oct 6, 2018 · 0 comments

Comments

@evgeniy-vashchuk
Copy link

I have a problem with generated sourcemaps, if I have gulp-autoprefixer in in the stream of my styles task. Source maps file is generated, but in browser they show absolutely wrong files. But if I remove gulp-autoprefixer from stream, sourcemaps are shown correctly. I know about Plugins with gulp sourcemaps support

3cc78d8df7

I try to insert autoprefixer by gulp-postcss, but in this way I have the same situation (wrong files in browser)

What I must to do, to be able to compile SASS with correct sourcemaps and with autoprefixer?

Code with gulp-autoprefixer:

// WORKING WITH SASS FILES
gulp.task('sass', function() {
	return gulp.src('dev/scss/all.scss')
	.pipe(sourcemaps.init())
	.pipe(sass({
		//outputStyle: 'compressed', // minify css (optional)
		indentType: 'tab',
		indentWidth: 1
	}).on("error", notify.onError({
		title: "Error compiling SASS"
	})))
	.pipe(autoprefixer(['last 3 versions']))
	.pipe(sourcemaps.write('.'))
	.pipe(gulp.dest('dev/css'))
	.pipe(browserSync.reload({stream: true}))
});

Code with postcss and autoprefixer:

// WORKING WITH SASS FILES
gulp.task('sass', function() {
	return gulp.src('dev/scss/all.scss')
	.pipe(sourcemaps.init())
	.pipe(sass({
		//outputStyle: 'compressed', // minify css (optional)
		indentType: 'tab',
		indentWidth: 1
	}).on("error", notify.onError({
		title: "Error compiling SASS"
	})))
	.pipe(postcss([ autoprefixer(['last 3 versions']) ]))
	.pipe(sourcemaps.write('.'))
	.pipe(gulp.dest('dev/css'))
	.pipe(browserSync.reload({stream: true}))
});
@evgeniy-vashchuk evgeniy-vashchuk changed the title Problem with gulp-sourcemaps with gulp-autoprefixer Problem with gulp-sourcemaps and gulp-autoprefixer Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant