-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (36 loc) · 1.1 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
const gulp = require("gulp");
const ts = require("gulp-typescript");
const webpack = require('webpack-stream');
const vueify = require('gulp-vueify');
const rimraf = require("gulp-rimraf");
const tsProject = ts.createProject('tsconfig.json');
const tsSrc = tsProject.src();
const vueSrc = "./src/**/*.vue";
const htmlSrc = "./src/**/*.html";
const cssSrc = "./src/**/*.css";
gulp.task('default', ['clean'], () => {
return gulp.start('webpack', 'transpile-ts', 'move-html', 'move-css');
});
gulp.task('clean', () => {
return gulp.src(['dist/'], { read: false })
.pipe(rimraf());
});
gulp.task('transpile-ts', () => {
return tsSrc
.pipe(tsProject())
.js
.pipe(gulp.dest("dist/"));
});
gulp.task('webpack', ['transpile-ts', 'move-html', 'move-css'], () => {
return gulp.src("src/views/static/js/main.tsx")
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest("dist/views/static/js"))
});
gulp.task('move-html', () => {
return gulp.src(htmlSrc)
.pipe(gulp.dest('dist/'));
});
gulp.task('move-css', () => {
return gulp.src(cssSrc)
.pipe(gulp.dest('dist/'));
});