forked from Renso/appdynamics-grafana-datasource
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
43 lines (34 loc) · 1.13 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
const gulp = require('gulp')
const ts = require('gulp-typescript')
const STATIC_FILES = ['src/*.json', 'src/**/*.json', 'src/**/*.md']
const tsProject = ts.createProject('tsconfig.json')
gulp.task('compile', () => {
const tsResult = tsProject.src()
.pipe(tsProject());
return tsResult.js.pipe(gulp.dest('dist'))
});
gulp.task('assets', function () {
return gulp.src(STATIC_FILES)
.pipe(gulp.dest('dist'));
});
gulp.task('partials', function () {
return gulp.src(['src/partials/*'])
.pipe(gulp.dest('dist/partials/'));
});
gulp.task('css', function () {
return gulp.src(['src/css/*'])
.pipe(gulp.dest('dist/css/'));
});
gulp.task('img', function () {
return gulp.src(['src/img/*'])
.pipe(gulp.dest('dist/img/'));
});
gulp.task('watch', ['compile'], () => {
gulp.watch('src/**/*.ts', ['compile']);
gulp.watch('src/**/*.json', ['assets']);
gulp.watch('src/**/*.md', ['assets']);
gulp.watch('src/partials/*', ['partials']);
gulp.watch('src/css/*', ['css']);
gulp.watch('src/img/*', ['img']);
})
gulp.task('default', ['watch', 'assets', 'partials', 'css', 'img']);