-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
gulpfile.js
84 lines (72 loc) · 2.94 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
73
74
75
76
77
78
79
80
81
82
83
84
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglifycss = require('gulp-uglifycss'),
rename = require('gulp-rename'),
flatten = require('gulp-flatten');
/** @deprecated */
gulp.task('build-css', function () {
return gulp
.src([process.env.INPUT_DIR + 'common/Common.css', process.env.INPUT_DIR + '**/*.css'])
.pipe(concat('primereact.css'))
.pipe(gulp.dest(process.env.OUTPUT_DIR + 'resources'))
.pipe(uglifycss({ uglyComments: true }))
.pipe(rename('primereact.min.css'))
.pipe(gulp.dest(process.env.OUTPUT_DIR + 'resources'));
});
gulp.task('build-primereactcss', function () {
return gulp.src(['./styles/primereact.css']).pipe(concat('primereact.css')).pipe(gulp.dest('dist/resources')).pipe(rename('primereact.min.css')).pipe(gulp.dest('dist/resources'));
});
gulp.task('build-themes', function () {
return (
gulp
.src(['public/themes/**/*'])
//.pipe(uglifycss({"uglyComments": true}))
.pipe(gulp.dest(process.env.OUTPUT_DIR + 'resources/themes'))
);
});
gulp.task('copy-fonts', function () {
return gulp.src(['public/themes/**/fonts/*'], { encoding: false }).pipe(gulp.dest(process.env.OUTPUT_DIR + 'resources/themes'));
});
/** @deprecated */
gulp.task('images', function () {
return gulp
.src([process.env.INPUT_DIR + '**/images/*.png', process.env.INPUT_DIR + '**/images/*.gif'])
.pipe(flatten())
.pipe(gulp.dest(process.env.OUTPUT_DIR + 'resources/images'));
});
gulp.task('build-exports', function () {
return gulp.src(['exports/*.js', 'exports/*.d.ts']).pipe(gulp.dest(process.env.OUTPUT_DIR));
});
gulp.task('build-meta', function () {
return gulp.src(['README.md', 'LICENSE.md']).pipe(gulp.dest(process.env.OUTPUT_DIR));
});
/** @deprecated */
gulp.task('copy-css', function () {
return gulp
.src([process.env.INPUT_DIR + '**/Common.css', process.env.INPUT_DIR + '**/*.css'])
.pipe(uglifycss({ uglyComments: true }))
.pipe(
rename(function (path) {
path.basename = path.basename.toLowerCase();
path.extname = '.min' + path.extname;
})
)
.pipe(gulp.dest('./' + process.env.OUTPUT_DIR));
});
gulp.task('copy-d.ts', function () {
return gulp
.src(process.env.INPUT_DIR + '**/*.d.ts')
.pipe(
rename(function (path) {
path.basename = path.basename.toLowerCase();
})
)
.pipe(gulp.dest('./' + process.env.OUTPUT_DIR));
});
gulp.task('copy-package.json', function () {
return gulp.src(process.env.INPUT_DIR + '**/package.json').pipe(gulp.dest('./' + process.env.OUTPUT_DIR));
});
//Building project with run sequence
gulp.task('copy-files', gulp.series('copy-d.ts', 'copy-package.json'));
gulp.task('build-resources', gulp.series('build-primereactcss', 'images', 'build-themes', 'copy-fonts', 'build-meta', 'copy-files'));