Guest User

Untitled

a guest
Nov 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. |-- dist
  2. |-- js
  3. |-- css
  4. |-- img
  5. |-- index.html
  6.  
  7. output: {
  8. filename: '[name]-[hash].bundle.js',
  9. path: path.resolve(__dirname, 'dist/js'),
  10. },
  11.  
  12. const gulp = require('gulp');
  13. const clean = require('gulp-clean');
  14.  
  15. gulp.task('clean-logs', () =>
  16. gulp.src('./logs/*.log', {
  17. read: false,
  18. }).pipe(clean()));
  19.  
  20. // Take all static files in the /dist directory
  21. // and organize them into folders based on type
  22. gulp.task('organize-dist-static-files', () => {
  23. gulp.src('./dist/*.{png,gif,jpg,jpeg,svg}')
  24. .pipe(gulp.dest('./dist/static/img'));
  25. gulp.src('./dist/*.js')
  26. .pipe(gulp.dest('./dist/static/js'));
  27. gulp.src('./dist/*.css')
  28. .pipe(gulp.dest('./dist/static/css'));
  29. gulp.src('./dist/*.{woff,woff2,eot,ttf,otf}')
  30. .pipe(gulp.dest('./dist/static/fonts'));
  31. });
  32.  
  33. gulp.task('clean-original-dist-files', () => {
  34. // remove files from original locations
  35. gulp.src('./dist/*.{png,gif,jpg,jpeg,svg,js,css,woff,woff2,eot,ttf,otf}', {
  36. read: false,
  37. }).pipe(clean());
  38. });
Add Comment
Please, Sign In to add comment