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('styles', function() {
return es.concat(gulp.src(vendorStyles), sass(siteStyles))
.pipe(plugins.concat('screen.min.css'))
.pipe(plugins.autoprefixer('last 2 versions', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4', 'Firefox >= 4'))
// .pipe(isProduction ? plugins.combineMediaQueries({ log: true }) : gutil.noop())
.pipe(isProduction ? plugins.cssnano() : gutil.noop())
.pipe(plugins.size())
.pipe(gulp.dest('./auth/static/styles'))
.pipe(browserSync.stream());
});
function bundle() {
gutil.log('Compiling JS...');
return bundler.bundle()
.on('error', (err) => {
gutil.log(err.message);
browserSync.notify('Browserify Error!');
this.emit('end');
})
.pipe(exorcist('public/js/bundle.js.map'))
.pipe(source('bundle.js'))
.pipe(gulp.dest('public/js'))
.pipe(browserSync.stream({once: true}));
}
return merge.apply(this, FILES.map(function(file) {
return gulp.src(file.src)
.pipe(plumber({ errorHandler: err }))
.pipe(sourcemap.init())
.pipe(concat(file.dest))
.pipe(gif(ENV.all.optimize, uglify()))
.pipe(sourcemap.write('.'))
.pipe(gulp.dest(DEST))
.pipe(bs.stream());
}));
export const css = () =>
src([
SRC + '/_assets/styl/kremalicious3.styl',
SRC + '/_assets/styl/post-*.styl'
])
.pipe($.if(!isProduction, $.sourcemaps.init()))
.pipe($.stylus({ 'include css': true })).on('error', onError)
.pipe($.postcss(plugins)).on('error', onError)
.pipe($.if(!isProduction, $.sourcemaps.write()))
.pipe($.if(isProduction, $.header(BANNER, { pkg })))
.pipe($.rename({ suffix: '.min' }))
.pipe(dest(DIST + '/assets/css/'))
.pipe(browser.stream())
gulp.task('js', 'Compiles JavaScript files with Rollup and runs results through Babel', () => {
return scripts.compile()
.on('error', failure('js'))
.pipe(gulp.dest(task.dest(config.folders.js)))
.pipe(sync.stream({
match: '**/*.js',
}));
});
gulp.task('scripts-reload', function() {
return buildScripts()
.pipe(browserSync.stream());
});
const svgSpriteTask = function() {
const settings = {
src: projectPath(PATH_CONFIG.src, PATH_CONFIG.icons.src, '*.svg'),
dest: projectPath(PATH_CONFIG.dest, PATH_CONFIG.icons.dest)
}
return gulp.src(settings.src)
.pipe(svgstore(TASK_CONFIG.svgSprite.svgstore))
.pipe(gulp.dest(settings.dest))
.pipe(browserSync.stream())
}
gulp.task('scripts-reload', function() {
return buildScripts()
.pipe(browserSync.stream());
});
gulp.task('scripts-reload', function () {
return buildScripts()
.pipe(browserSync.stream());
});
function rebundle() {
const stream = bundler.bundle();
return stream.on('error', handleErrors)
.pipe(source(file))
.pipe(gulp.dest(config.scripts.dest))
.pipe(browserSync.stream());
}