Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. var gulp = require('gulp');
  2. var webserver = require('gulp-webserver');
  3. var source = require('vinyl-source-stream');
  4. var browserify = require('browserify');
  5. var plugins = require('gulp-load-plugins')();
  6.  
  7. //web server立ち上げ
  8. gulp.task('webserver', function() {
  9. gulp.src('./')
  10. .pipe(webserver({
  11. livereload: true,
  12. port: 8000,
  13. fallback: 'index.html',
  14. open: true
  15. }));
  16. });
  17.  
  18. //watch
  19. gulp.task('watch', function() {
  20. gulp.watch("js/*.js", ["build3"]);
  21. });
  22.  
  23. //uglify + concat
  24. gulp.task('build', function() {
  25. gulp.src(['js/app3.js', 'js/app2.js', 'js/app.js'])
  26. .pipe(plugins.uglify())
  27. .pipe(plugins.concat('all.min.js'))
  28. .pipe(gulp.dest('dist/js/'));
  29. });
  30.  
  31. //ngAnotate
  32. gulp.task('build2', function () {
  33. return gulp.src('js/app.js')
  34. .pipe(plugins.ngAnnotate())
  35. .pipe(gulp.dest('dist'));
  36. });
  37.  
  38. //browserify + debowerify
  39. gulp.task('build3', function(){
  40. browserify({
  41. entries: ['js/app.js'],
  42. })
  43. .transform("debowerify", {preferNPM: true})
  44. .bundle()
  45. .pipe(source('app.js'))
  46. .pipe(gulp.dest('dist'));
  47. });
  48.  
  49. gulp.task('default', ['webserver']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement