-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
52 lines (43 loc) · 1.14 KB
/
gulpfile.js
File metadata and controls
52 lines (43 loc) · 1.14 KB
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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const del = require('del');
// Paths
const paths = {
build: './dist',
source: './src',
};
// Clean Destination
function taskCleanDestination() {
return del([`${paths.build}/**/*`]);
}
// Transpile Typescript
function taskTranspileTypescript() {
const tsProject = ts.createProject('tsconfig.json');
const result = tsProject.src().pipe(tsProject());
return result.js.pipe(gulp.dest('dist'));
}
// Copy Declarations
function taskCopyDeclarations() {
return gulp
.src(`${paths.source}/declarations/**/*`)
.pipe(gulp.dest(`${paths.build}/declarations`));
}
// Copy Images
function taskCopyImages() {
return gulp
.src(`${paths.source}/images/**/*`)
.pipe(gulp.dest(`${paths.build}/images`));
}
// Build Library
const taskBuildLibrary = gulp.series([
taskCleanDestination,
taskTranspileTypescript,
taskCopyDeclarations,
taskCopyImages,
]);
// Exports
exports.clean = taskCleanDestination;
exports.transpile = taskTranspileTypescript;
exports.copyDeclarations = taskCopyDeclarations;
exports.copyImages = taskCopyImages;
exports.build = taskBuildLibrary;