Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. const gulp = require('gulp');
  2. const clean = require('gulp-clean');
  3. const ts = require('gulp-typescript');
  4.  
  5. const tsProject = ts.createProject('tsconfig.json');
  6.  
  7. gulp.task('scripts', ['static'], () => {
  8. const tsResult = tsProject.src()
  9. .pipe(tsProject());
  10.  
  11. return tsResult.js
  12. .pipe(gulp.dest('dist'));
  13. });
  14.  
  15. gulp.task('static', ['clean'], () => {
  16. return gulp
  17. .src(['src/**/*.json'])
  18. .pipe(gulp.dest('dist'));
  19. });
  20.  
  21. gulp.task('clean', () => {
  22. return gulp
  23. .src('dist')
  24. .pipe(clean());
  25. });
  26.  
  27. gulp.task('build', ['scripts']);
  28.  
  29. gulp.task('watch', ['build'], () => {
  30. return gulp.watch(['src/**/*.js', 'src/**/*.json'], ['build']);
  31. });
  32.  
  33. gulp.task('default', ['watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement