Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
.on('end', function() {
gutil.log(gutil.colors.green(file + ' DONE'));
})
.pipe(source(file))
.pipe(buffer())
.pipe(sourcemap ? sourcemaps.init({loadMaps: true}) : gutil.noop())
// Add transformation tasks to the pipeline here.
.pipe(replace('', hash))
.pipe(ugly ? uglify() : gutil.noop())
.pipe(sourcemap ? sourcemaps.write('./') : gutil.noop())
.pipe(gulp.dest('./build'))
.on('end', function () {
callback();
})
.pipe(reload ? connect.reload() : gutil.noop());
}
function bundle() {
return bundler.bundle()
// log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source(config.outputName))
.pipe(gulp.dest(config.dest))
.pipe(connect.reload());
}
function bundle() {
return bundler.bundle()
// log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source(config.outputName))
.pipe(gulp.dest(config.dest))
.pipe(connect.reload())
}
function rebundle() {
return bundler.bundle()
.on('error', handleError)
.pipe(source('main.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(devBuildDir))
.pipe(connect.reload());
}
function bundle () {
return bundler.bundle()
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'))
.pipe(connect.reload())
}
gulp.task('build:styles', function () {
gulp.src('src/less/*.less')
.pipe(less({
paths: [
path.join(__dirname, 'less', 'includes')
]
}))
.pipe(gulp.dest('dist'))
.pipe(cssmin())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'))
.pipe(connect.reload());
});
gulp.task('reload', function () {
return gulp.src(['index.html'])
.pipe(connect.reload())
})
gulp.task('copy:src', function(){
return gulp.src([
'src/bootstrap.js',
'src/index.html',
'src/**/*.html',
'src/**/*.css'
])
.pipe(gulp.dest('dist'))
.pipe(connect.reload());
});
gulp.task('reloadServer', function() {
gulp.src(paths.outputDir)
.pipe(connect.reload());
});
gulp.task('livereload', function () {
return gulp.src( WEB_PATH + '/**/*' )
.pipe(connect.reload());
});