-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (32 loc) · 927 Bytes
/
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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const zip = require('gulp-zip');
const srcPath = 'src/**/*.ts';
const distPath = './dist';
function swallowError(error) {
console.log(error.toString());
this.emit('end');
}
gulp.task('compile:typescript', () => {
const tsResult = gulp.src(srcPath)
.pipe(ts({
//noImplicitAny: true,
//outFile: 'index.js',
target: "ES5"
}))
.on('error', swallowError);
return tsResult.js
.pipe(gulp.dest(distPath));
});
gulp.task('watch', () => {
gulp.watch([srcPath], ['compile:typescript']);
});
gulp.task('publish:aws', ['compile:typescript'], () => {
return gulp.src([
`${distPath}/*.@(js|json)`,
`!${distPath}/trustscore.js`
])
.pipe(zip('trustscore-calculator.zip'))
.pipe(gulp.dest(`${distPath}/aws`));
});
gulp.task('default', ['compile:typescript']);