Closed Scorpovi4 closed 4 years ago
After I've changed build structure to the below, paths (background) inside destination css files became build from folder where source sass files lay.
inside scss before convertation : background: url('../images/index/first-bg-desktop.jpg') top left/100% no-repeat;
background: url('../images/index/first-bg-desktop.jpg') top left/100% no-repeat;
inside css after: background: url(../../scss/images/index/first-bg-desktop.jpg) 0 0/100% no-repeat;
background: url(../../scss/images/index/first-bg-desktop.jpg) 0 0/100% no-repeat;
gulp.src($.srcAssets + 'scss/_pages/**/*', { since: gulp.lastRun('sass') }) .pipe(newer($.distCss)) .pipe( flatmap(function(stream, file) { let basename = path.basename(file.path, '.scss'); return streamqueue( { objectMode: true }, ... , gulp .src([$.srcAssets + 'scss/style.scss']) .pipe( plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }) ) .pipe(sass()), gulp .src([file.path]) .pipe( plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }) ) .pipe(sass()) ) ... })) .pipe(concatCss(basename + '.css')) .pipe(gcmq()) .pipe(postcss(plugins)) .pipe(gulp.dest($.distCss));
Issue was in gulp-concate-css which I used to concate css. It replaced paths inside destination css for some reason... Replaced this plugin for gulp-concate and issue has been resolved.
gulp-concate-css
gulp-concate
After I've changed build structure to the below, paths (background) inside destination css files became build from folder where source sass files lay.
inside scss before convertation :
background: url('../images/index/first-bg-desktop.jpg') top left/100% no-repeat;
inside css after:
background: url(../../scss/images/index/first-bg-desktop.jpg) 0 0/100% no-repeat;