Answer the question
In order to leave comments, you need to log in
How to get sourcemaps if all scss files are imported into one?
Hello!
Set up project build using gulp. The project uses the SCSS preprocessor and all necessary scss files (bootstrap, native files) are imported in the main main.scss file. Import order matters.
But when viewed in a browser, it shows the line number in the main.css file
Part of gulpfile.js
gulp.task('styles', () => {
return gulp.src('src/scss/main.scss')
.pipe(gulpIf(env === "dev", sourcemaps.init()))
.pipe(concat('main.scss'))
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({cascade: false}))
.pipe(gcmq())
.pipe(gulpIf(env === "prod", cleanCSS({level: 2})))
.pipe(gulpIf(env === "dev", sourcemaps.write()))
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream());
});
@import "variables";
@import "../../node_modules/bootstrap/scss/bootstrap";
@import "sceleton";
@import "header";
...
@import "footer";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question