Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. var gulp = require('gulp'),
  2. webserver = require('gulp-webserver'),
  3. typescript = require('gulp-typescript'),
  4. sourcemaps = require('gulp-sourcemaps'),
  5. tscConfig = require('./tsconfig.json');
  6.  
  7. var appSrc = 'www/',
  8. tsSrc = 'typescript/';
  9.  
  10. gulp.task('html', function() {
  11. gulp.src(appSrc + '**/*.html');
  12. });
  13.  
  14. gulp.task('css', function() {
  15. gulp.src(appSrc + '**/*.css');
  16. });
  17.  
  18. // gulp.task('copylibs', function() {
  19. // return gulp
  20. // .src([
  21. // 'node_modules/es6-shim/es6-shim.min.js',
  22. // 'node_modules/systemjs/dist/system-polyfills.js',
  23. // 'node_modules/angular2/bundles/angular2-polyfills.js',
  24. // 'node_modules/systemjs/dist/system.src.js',
  25. // 'node_modules/rxjs/bundles/Rx.js',
  26. // 'node_modules/angular2/bundles/angular2.dev.js'
  27. // ])
  28. // .pipe(gulp.dest(appSrc + 'js/lib/angular2'));
  29. // });
  30.  
  31. gulp.task('typescript', function () {
  32. return gulp
  33. .src(tsSrc + '**/*.ts')
  34. .pipe(sourcemaps.init())
  35. .pipe(typescript(tscConfig.compilerOptions))
  36. .pipe(sourcemaps.write('.'))
  37. .pipe(gulp.dest(appSrc + 'js/'));
  38. });
  39.  
  40. gulp.task('watch', function() {
  41. gulp.watch(tsSrc + '**/*.ts', ['typescript']);
  42. gulp.watch(appSrc + 'css/*.css', ['css']);
  43. gulp.watch(appSrc + '**/*.html', ['html']);
  44. });
  45.  
  46. gulp.task('webserver', function() {
  47. gulp.src(appSrc)
  48. .pipe(webserver({
  49. livereload: true,
  50. open: true
  51. }));
  52. });
  53.  
  54. gulp.task('default', [/*'copylibs',*/ 'typescript', 'watch', 'webserver']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement