forked from kdietrich/gridstack-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (47 loc) · 1.33 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict'
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var header = require('gulp-header');
var bases = {
app: 'src/',
dist: 'dist/',
};
var paths = {
scripts: ['**/*.js']
};
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @author <%= pkg.author %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
// Delete the dist directory
gulp.task('clean', function() {
return gulp.src(bases.dist)
.pipe(clean());
});
// Process scripts and concatenate them into one output file
gulp.task('scripts', ['clean'], function() {
gulp.src(paths.scripts, {cwd: bases.app})
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(uglify())
.pipe(concat('gridstack-angular.min.js'))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest(bases.dist));
gulp.src(paths.scripts, {cwd: bases.app})
.pipe(concat('gridstack-angular.js'))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest(bases.dist));
});
// Define the default task as a sequence of the above tasks
gulp.task('default', ['clean', 'scripts']);