forked from alex7kom/golden-colors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
69 lines (62 loc) · 1.59 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var gulp = require('gulp');
var umd = require('gulp-umd');
var rename = require('gulp-rename');
var clone = require('gulp-clone');
var uglify = require('gulp-uglify');
var header = require('gulp-header');
var markdown = require('gulp-markdown');
var concatExtra = require('gulp-concat-extra');
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');
var uglifyParams = {
preserveComments: 'license'
};
gulp.task('default', function () {
var script = gulp.src('golden-colors.js');
script
.pipe(clone())
.pipe(header(banner, { pkg: pkg } ))
.pipe(gulp.dest('dist'))
.pipe(uglify(uglifyParams))
.pipe(rename('golden-colors.min.js'))
.pipe(gulp.dest('dist'));
script
.pipe(clone())
.pipe(umd({
exports: function (file) {
return 'goldenColors';
},
namespace: function (file) {
return 'goldenColors';
}
}))
.pipe(header(banner, { pkg: pkg } ))
.pipe(rename('golden-colors-amd.js'))
.pipe(gulp.dest('dist'))
.pipe(uglify(uglifyParams))
.pipe(rename('golden-colors-amd.min.js'))
.pipe(gulp.dest('dist'));
gulp.src('README.md')
.pipe(markdown())
.pipe(rename('index.html'))
.pipe(concatExtra({
'index.html': {
prepend: [
'_html/header.html'
],
append: [
'_html/footer.html'
]
}
}))
.pipe(gulp.dest('.'));
});