forked from primefaces/primereact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (52 loc) · 1.78 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
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglifycss = require('gulp-uglifycss'),
rename = require('gulp-rename'),
flatten = require('gulp-flatten');
gulp.task('build-css', function() {
return gulp.src([
'src/components/common/Common.css',
'src/components/**/*.css'
])
.pipe(concat('primereact.css'))
.pipe(gulp.dest('dist/resources'))
.pipe(uglifycss({"uglyComments": true}))
.pipe(rename('primereact.min.css'))
.pipe(gulp.dest('dist/resources'));
});
gulp.task('build-themes', function() {
return gulp.src([
'public/themes/**/*',
'!public/themes/soho-*',
'!public/themes/soho-*/**/*',
'!public/themes/viva-*',
'!public/themes/viva-*/**/*',
'!public/themes/mira',
'!public/themes/mira/**/*',
'!public/themes/nano',
'!public/themes/nano/**/*'
])
//.pipe(uglifycss({"uglyComments": true}))
.pipe(gulp.dest('dist/resources/themes'));
})
gulp.task('images', function() {
return gulp.src(['src/components/**/images/*.png', 'src/components/**/images/*.gif'])
.pipe(flatten())
.pipe(gulp.dest('dist/resources/images'));
});
gulp.task('build-exports', function() {
return gulp.src(['exports/*.js','exports/*.d.ts'])
.pipe(gulp.dest('dist'));
});
gulp.task('build-meta', function() {
return gulp.src(['README.md','LICENSE.md', 'package-build.json'])
.pipe(rename(function(path) {
if (path.basename === 'package-build') {
path.basename = path.basename.replace('package-build', 'package');
}
}))
.pipe(gulp.dest('dist'));
});
//Building project with run sequence
gulp.task('build-resources', gulp.series('build-css','images', 'build-themes', 'build-meta'));