-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgulpfile.js
39 lines (30 loc) · 1.21 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
import gulp from 'gulp';
import tscript from 'gulp-typescript';
import {deleteAsync as del} from 'del';
import npmDist from 'gulp-npm-dist';
import rename from 'gulp-rename';
const tsProject = tscript.createProject('tsconfig.json');
export function ts() {
var tsResult = tsProject.src()
.pipe(tsProject());
return tsResult.js.pipe(gulp.dest('target/sbt/web/public/main/javascripts'));
}
export function copyVendored() {
return gulp.src('app/assets/vendored/**')
.pipe(gulp.dest('target/sbt/web/public/main/'));
}
export function copy() {
return gulp.src(npmDist(), {base:'./node_modules'})
.pipe(rename(function(path) {
path.dirname = path.dirname.replace(/\/dist/, '').replace(/\\dist/, '');
// path.dirname = path.dirname.replace(/\/build/, '').replace(/\\build/, '');
}))
.pipe(gulp.dest('target/sbt/web/public/main/lib'));
}
export function clean() {
// You can use multiple globbing patterns as you would with `gulp.src`,
// for example if you are using del 2.0 or above, return its promise
return del([ 'target/sbt/web/public/main' ]);
}
const build = gulp.series(clean, gulp.parallel(ts, copy, copyVendored));
export default build;