gulpfile.js 765 B

12345678910111213141516171819202122232425262728
  1. var gulp = require('gulp');
  2. var concat = require('gulp-concat');
  3. var uglify = require('gulp-uglify');
  4. var rename = require('gulp-rename');
  5. var sourcemaps = require('gulp-sourcemaps');
  6. var browserSync = require('browser-sync').create();
  7. var reload = browserSync.reload;
  8. gulp.task('build', function() {
  9. gulp.src(['lib/browser/js-yaml.js', 'lib/browser/index.js'])
  10. .pipe(sourcemaps.init())
  11. .pipe(concat('js-yaml-front-client.js'))
  12. .pipe(gulp.dest('./dist'))
  13. .pipe(uglify())
  14. .pipe(rename('js-yaml-front-client.min.js'))
  15. .pipe(sourcemaps.write('./'))
  16. .pipe(gulp.dest('./dist'));
  17. });
  18. gulp.task('serve', ['build'], function() {
  19. browserSync.init({
  20. server: {
  21. baseDir: "./examples"
  22. }
  23. });
  24. });
  25. gulp.task('default', ['build']);