Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. 'use strict';
  2.  
  3. var gulp = require('gulp');
  4.  
  5. var paths = gulp.paths;
  6.  
  7. var $ = require('gulp-load-plugins')();
  8.  
  9. var wiredep = require('wiredep').stream;
  10.  
  11. gulp.task('inject', ['styles'], function () {
  12.  
  13. var injectStyles = gulp.src([
  14. paths.tmp + '/serve/{app,components}/**/*.css',
  15. '!' + paths.tmp + '/serve/app/vendor.css'
  16. ], { read: false });
  17.  
  18. var injectScripts = gulp.src([
  19. paths.src + '/{app,components,scripts}/**/*.js',
  20. '!' + paths.src + '/{app,components}/**/*.spec.js',
  21. '!' + paths.src + '/{app,components}/**/*.mock.js'
  22. ]).pipe($.angularFilesort());
  23.  
  24. var injectOptions = {
  25. ignorePath: [paths.src, paths.tmp + '/serve'],
  26. addRootSlash: false
  27. };
  28.  
  29. var wiredepOptions = {
  30. directory: 'bower_components',
  31. exclude: [/bootstrap-sass-official/, /bootstrap\.css/, /bootstrap\.css/, /foundation\.css/]
  32. };
  33.  
  34. return gulp.src(paths.src + '/*.html')
  35. .pipe($.inject(injectStyles, injectOptions))
  36. .pipe($.inject(injectScripts, injectOptions))
  37. .pipe(wiredep(wiredepOptions))
  38. .pipe(gulp.dest(paths.tmp + '/serve'));
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement