Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('compile-styles', () => {
return gulp.src(sassPaths.src)
.pipe(plumber((error) => {
console.log(error);
this.emit('end');
}))
.pipe(gulpIf(isDevelopment, sourcemaps.init()))
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gcmq())
.pipe(cssnano())
// .pipe(uncss({
// html: [dirs.dest + '/**/*.html']
// }))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulpIf(isDevelopment, sourcemaps.write('.')))
.pipe(gulp.dest(sassPaths.dest))
.pipe(browserSync.reload({stream: true}));
});
function buildStyles() {
return gulp.src(styles.glob)
.pipe(sourcemaps.init())
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer({ browsers: ['> 1%'], cascade: false }))
// .pipe(uncss({ html: [path.join(dist.dir, '**/*.html')] }))
.pipe(cssnano())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(path.join(dist.dir, 'css/')))
}
gulp.task('sass', function () {
return gulp.src('./frontend/sass/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(concat('app.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest(dist.css));
});
gulp.task('webapp:sasscompile', function() {
return gulp.src('app/styles/index.scss')
.pipe(sass.sync().on('error', util.log))
.pipe(gulp.dest(options.srcFolderPath + '/styles'));
});
gulp.task('style:build', function(){
gulp.src(path.src.style)
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer({
browsers : ['last 9 versions', 'ie 9', '> 1%']
}))
.pipe(postcss([assets({
loadPaths : ['src/images/*']
})]))
.pipe(gulp.dest(path.build.css))
.pipe(browserSync.stream());
});
gulp.task('sass', function () {
return gulp.src('./resources/sass/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('./resources/css'));
});
gulp.task('sass', function () {
return gulp.src('src/scss/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(prefix('last 2 versions'))
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream());
});
function buildSass(moduleName) {
return gulp.src(paths.sass)
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest(paths.output + moduleName));
}
gulp.task('style:common', () => {
return gulp.src('src/views/style.scss')
.pipe(sass.sync({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest('media'));
});