Gulpfile错误地将angular文件加载到index.html中
Gulpfile is incorrectly loading angular files into index.html
我正在使用gulp-inject来创建一个index.html页面。我注意到,在他们的文档中,他们展示了如何加载angular文件和java文件,所以请遵循基本的说明。
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/'))
});
然而,当我看到我的angular文件的构建方式时,它看起来几乎是相反的。我现在只有三个angular文件,所以它看起来像这样:
'use strict';
app.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/client/partials/home.html'
})
}
]);
'use strict';
var app = angular.module('app', ['ngRoute']);
我如何以正确的顺序加载我的angular文件并将它们连接起来?
啊。唉,我找到问题了。
.pipe(angularFilesort())
.pipe(concat('app.min.js'))
应该.pipe(concat('app.min.js'))
.pipe(angularFilesort())
对不起。
相关文章:
- 分析高度属性时出现意外值{{specs.height}}.index.html
- AngularJS-需要在index.html页面中访问来自服务的数据
- index.html使用webpack开发服务器未重新加载
- 从index.html调用函数,该函数无限循环
- RouteChangeStart事件在初始index.html页面加载时触发
- Angular2:Index.html没有't显示该文件;正在加载&”;
- 如何使用gulp-inject将文件的内容插入到我的index.html中
- 使url匹配'/''/索引'和'/index.html'到单一状态
- 将所有angular2捆绑包包含在index.html中会使导入从内存获取数据,而不是再次从服务器请求数据
- 咕哝式发球;t将index.html与'/'要求
- AngularJS应用程序:如何将.js文件包含到index.html中
- 无法从index.html调用javascript函数
- 捕获刷新并将页面更改为index.html
- 添加java脚本后,Dropdown Menu无法在Index.html上工作
- jquery手机应用程序的第一页必须是index.html
- Angular 2-我如何使我的index.html文件的标题和关键字和描述的元标签是动态的
- 使index.html的默认状态不带#something
- 从'更改不同语言的图像;index.html'到'关于.html'
- ng递归地包括整个index.html;达到“10$digest()迭代”;
- angular-index.html只识别默认路由中定义的函数