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

26 lines
717 B
JavaScript

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