This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/gulpfile.js

27 lines
717 B
JavaScript
Raw Normal View History

2018-09-30 18:21:59 +00:00
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
2018-09-30 20:23:16 +00:00
var coffee = require('gulp-coffee');
var insert = require('gulp-insert');
2018-09-30 18:21:59 +00:00
var uglify = require('gulp-uglify-es').default;
2018-09-30 20:23:16 +00:00
var concat = require('gulp-concat');
2018-09-30 18:21:59 +00:00
var paths = {
2018-09-30 20:23:16 +00:00
scripts: 'client/scripts/**/*.coffee',
2018-09-30 18:21:59 +00:00
images: 'client/img/**/*'
};
gulp.task('js', function(){
return gulp.src(paths.scripts)
.pipe(sourcemaps.init())
.pipe(concat('app.min.js'))
2018-09-30 20:23:16 +00:00
.pipe(coffee({bare: true}))
.pipe(insert.transform(function(contents, file) {
return '$(function () {' + contents + '});';
}))
2018-09-30 18:21:59 +00:00
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('static'))
});
gulp.task('default', [ 'js' ]);