Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var gulp = require('gulp');
- var paths = gulp.paths;
- var $ = require('gulp-load-plugins')();
- var wiredep = require('wiredep').stream;
- gulp.task('inject', ['styles'], function () {
- var injectStyles = gulp.src([
- paths.tmp + '/serve/{app,components}/**/*.css',
- '!' + paths.tmp + '/serve/app/vendor.css'
- ], { read: false });
- var injectScripts = gulp.src([
- paths.src + '/{app,components,scripts}/**/*.js',
- '!' + paths.src + '/{app,components}/**/*.spec.js',
- '!' + paths.src + '/{app,components}/**/*.mock.js'
- ]).pipe($.angularFilesort());
- var injectOptions = {
- ignorePath: [paths.src, paths.tmp + '/serve'],
- addRootSlash: false
- };
- var wiredepOptions = {
- directory: 'bower_components',
- exclude: [/bootstrap-sass-official/, /bootstrap\.css/, /bootstrap\.css/, /foundation\.css/]
- };
- return gulp.src(paths.src + '/*.html')
- .pipe($.inject(injectStyles, injectOptions))
- .pipe($.inject(injectScripts, injectOptions))
- .pipe(wiredep(wiredepOptions))
- .pipe(gulp.dest(paths.tmp + '/serve'));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement