22 lines
556 B
JavaScript
22 lines
556 B
JavaScript
var gulp = require('gulp');
|
|
var sourcemaps = require('gulp-sourcemaps');
|
|
var concat = require('gulp-concat');
|
|
var uglify = require('gulp-uglify-es').default;
|
|
var selfExecute = require('gulp-self-execute');
|
|
|
|
var paths = {
|
|
scripts: 'client/js/**/*.js',
|
|
images: 'client/img/**/*'
|
|
};
|
|
|
|
gulp.task('js', function(){
|
|
return gulp.src(paths.scripts)
|
|
.pipe(sourcemaps.init())
|
|
.pipe(concat('app.min.js'))
|
|
.pipe(uglify())
|
|
.pipe(selfExecute())
|
|
.pipe(sourcemaps.write())
|
|
.pipe(gulp.dest('static'))
|
|
});
|
|
|
|
gulp.task('default', [ 'js' ]);
|