javascript - Gulpfile is incorrectly loading angular files into index.html -
i using gulp-inject create index.html page. noticed in documentation showed both how load angular files , bower files followed basic instructions.
var angularfilesort = require('gulp-angular-filesort'), bowerfiles = require('main-bower-files'); gulp.task('index', function () { var angularstream = gulp.src('client/**/*.js', { base: './' }) .pipe(angularfilesort()) .pipe(concat('app.min.js')) .pipe(gulp.dest('./build/client/scripts')); gulp.src('./server/templates/index.html') .pipe(inject(gulp.src(bowerfiles(), { read: false }), { name: 'bower'})) .pipe(inject(es.merge(angularstream))) .pipe(gulp.dest('./build/client/')) });
however, when @ way angular files built, looks in reverse. have 3 angular files now, looks this:
'use strict'; app.config(['$routeprovider', function ($routeprovider) { $routeprovider.when('/', { templateurl: '/client/partials/home.html' }) } ]); 'use strict'; var app = angular.module('app', ['ngroute']);
how load angular files in correct order , concatenate them?
ah. alas, found problem.
.pipe(angularfilesort()) .pipe(concat('app.min.js'))
should be
.pipe(concat('app.min.js')) .pipe(angularfilesort())
sorry bout that.
Comments
Post a Comment