-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (37 loc) · 1.09 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
var gulp = require('gulp');
var watch = require('gulp-watch');
var babel = require('gulp-babel');
var ts = require('gulp-typescript');
var webpack = require('gulp-webpack');
gulp.task('markup', function(){
return watch('app/*.html',{ignoreInitial: false})
.pipe(gulp.dest('dist/'));
});
gulp.task('css', function(){
return watch('app/css/*.css',{ignoreInitial: false})
.pipe(gulp.dest('dist/css'));
});
// gulp.task('js', function(){
// return watch('app/js/*.js',{ignoreInitial: false})
// .pipe(gulp.dest('dist/'));
// });
gulp.task('ts', function(){
return watch('app/ts/*.ts',function(){
gulp.src('app/ts/*.ts')
.pipe(ts({
module:'commonjs'
}))
.pipe(gulp.dest('dist'));
});
});
gulp.task('webpack', function() {
return watch('dist/main.js', function(){
gulp.src('dist/main.js')
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('dist/'));
});
// return gulp.src('dist/main.js')
// .pipe(webpack(require('./webpack.config.js')))
// .pipe(gulp.dest('dist/'));
});
gulp.task('default', ['markup','css','ts','webpack']);