forked from primefaces/primeng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·72 lines (61 loc) · 2.14 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
70
71
72
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglifycss = require('gulp-uglifycss'),
rename = require('gulp-rename'),
del = require('del'),
flatten = require('gulp-flatten');
gulp.task('build-css', function() {
gulp.src([
'src/app/components/common/common.css',
'src/app/components/**/*.css'
])
.pipe(concat('primeng.css'))
.pipe(gulp.dest('dist/resources'));
});
gulp.task('build-css-prod', function() {
gulp.src([
'src/app/components/common/common.css',
'src/app/components/button/button.css',
'src/app/components/checkbox/checkbox.css',
'src/app/components/colorpicker/colorpicker-images.css',
'src/app/components/inputtext/inputtext.css',
'src/app/components/inputtextarea/inputtextarea.css',
'src/app/components/password/password.css',
'src/app/components/radiobutton/radiobutton.css',
'src/app/components/tooltip/tooltip.css'
])
.pipe(concat('primeng.css'))
.pipe(gulp.dest('dist/resources'))
.pipe(uglifycss({"uglyComments": true}))
.pipe(rename('primeng.min.css'))
.pipe(gulp.dest('dist/resources'));
});
gulp.task('copy-component-css', function () {
gulp.src([
'src/app/components/**/*.css',
'src/app/components/**/images/*.png',
'src/app/components/**/images/*.gif'
])
.pipe(gulp.dest('dist/resources/components'));
});
gulp.task('images', function() {
return gulp.src(['src/app/components/**/images/*.png', 'src/app/components/**/images/*.gif'])
.pipe(flatten())
.pipe(gulp.dest('dist/resources/images'));
});
gulp.task('themes', function() {
return gulp.src(['src/assets/components/themes/**/*'])
.pipe(gulp.dest('dist/resources/themes'));
});
//Cleaning previous gulp tasks from project
gulp.task('clean', function() {
del(['dist/resources']);
});
//Copy readme
gulp.task('readme', function() {
gulp.src(['README.md'])
.pipe(gulp.dest('dist'));
});
//Building project with run sequence
gulp.task('build-assets', ['clean','copy-component-css', 'build-css-prod', 'images', 'themes', 'readme']);