mirror of
https://github.com/status-im/cn.status.im.git
synced 2025-01-09 16:15:58 +00:00
use modern function formatting
This commit is contained in:
parent
b8dd17a701
commit
74db3a4c5e
21
gulpfile.js
21
gulpfile.js
@ -19,14 +19,13 @@ var htmlmin = require('gulp-htmlmin')
|
|||||||
|
|
||||||
var imagemin = require('gulp-imagemin')
|
var imagemin = require('gulp-imagemin')
|
||||||
|
|
||||||
gulp.task('js', function () {
|
gulp.task('js', () => {
|
||||||
return gulp.src('src/js/**/*.js', {read: false})
|
return gulp.src('src/js/**/*.js', {read: false})
|
||||||
.pipe(sourcemaps.init({loadMaps: true}))
|
.pipe(sourcemaps.init({loadMaps: true}))
|
||||||
.pipe(tap(function (file) {
|
.pipe(tap((f) => {
|
||||||
//gutil.log('bundling ' + file.path)
|
f.contents = browserify(f.path, {debug: true}).bundle()
|
||||||
file.contents = browserify(file.path, {debug: true}).bundle()
|
|
||||||
}))
|
}))
|
||||||
.pipe(streamify(babel({ presets: ['es2015', 'es2017'] })))
|
.pipe(streamify(babel({presets: ['es2015', 'es2017']})))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
.pipe(sourcemaps.write('./'))
|
.pipe(sourcemaps.write('./'))
|
||||||
@ -34,19 +33,19 @@ gulp.task('js', function () {
|
|||||||
.pipe(browserSync.stream())
|
.pipe(browserSync.stream())
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('fonts', function() {
|
gulp.task('fonts', () => {
|
||||||
return gulp.src(['src/fonts**/*'])
|
return gulp.src(['src/fonts**/*'])
|
||||||
.pipe(gulp.dest('dist'))
|
.pipe(gulp.dest('dist'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('html', function() {
|
gulp.task('html', () => {
|
||||||
return gulp.src(['src/**/*.html'])
|
return gulp.src(['src/**/*.html'])
|
||||||
.pipe(htmlmin({collapseWhitespace: true, minifyJS: true}))
|
.pipe(htmlmin({collapseWhitespace: true, minifyJS: true}))
|
||||||
.pipe(rename(p => p.dirname = p.dirname.slice(5)))
|
.pipe(rename(p => p.dirname = p.dirname.slice(5)))
|
||||||
.pipe(gulp.dest('dist'))
|
.pipe(gulp.dest('dist'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('css', function() {
|
gulp.task('css', () => {
|
||||||
return gulp.src("src/scss/main.scss")
|
return gulp.src("src/scss/main.scss")
|
||||||
.pipe(sass())
|
.pipe(sass())
|
||||||
.on('error', gutil.log)
|
.on('error', gutil.log)
|
||||||
@ -55,17 +54,17 @@ gulp.task('css', function() {
|
|||||||
.pipe(browserSync.stream())
|
.pipe(browserSync.stream())
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('images', function() {
|
gulp.task('images', () => {
|
||||||
gulp.src('src/img/**/*')
|
gulp.src('src/img/**/*')
|
||||||
.pipe(imagemin())
|
.pipe(imagemin())
|
||||||
.pipe(gulp.dest('dist/img'))
|
.pipe(gulp.dest('dist/img'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('clean', function() {
|
gulp.task('clean', () => {
|
||||||
del.sync('dist/*')
|
del.sync('dist/*')
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('develop', ['build'], function() {
|
gulp.task('develop', ['build'], () => {
|
||||||
browserSync.init({server: "./dist"})
|
browserSync.init({server: "./dist"})
|
||||||
|
|
||||||
gulp.watch("src/scss/*.scss", ['css'])
|
gulp.watch("src/scss/*.scss", ['css'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user