SHARE
TWEET

Untitled

a guest Jul 15th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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']);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top