Skip to content

Commit

Permalink
[FIX] add missing dependency to ui.bootstrap.tpls from cat.templates
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalzinger committed Apr 1, 2015
1 parent 5654387 commit e6c4547
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 14 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gulp.ngdocs = require('gulp-ngdocs');
gulp.bump = require('gulp-bump');
gulp.git = require('gulp-git');
gulp.util = require('gulp-util');
gulp.header = require('gulp-header');

var q = require('q');
var prettyTime = require('pretty-hrtime');
Expand Down Expand Up @@ -156,18 +157,24 @@ var less2css = function () {
.pipe(gulp.dest(dest));
};

var _concatenateAndUglify = function (name) {
var _concatenateAndUglify = function (name, header) {
var jsFilter = gulp.filter('**/*.js');

function applyJsFilter() {
return jsFilter;
}

return lazypipe()
var pipe = lazypipe()
.pipe(applyJsFilter) // filter out '*.js.tpl' files
.pipe(gulp.ngAnnotate, {gulpWarnings: false})
.pipe(jsFilter.restore) // restore all files
.pipe(gulp.concat, name + '.js')
.pipe(gulp.concat, name + '.js');

if (!!header) {
pipe = pipe.pipe(gulp.header, header);
}

return pipe
.pipe(gulp.sourcemaps.write, '.', {sourceRoot: 'src'})
.pipe(gulp.dest, config.paths.dist)
.pipe(gulp.filter, ['**/*.js'])
Expand All @@ -184,11 +191,13 @@ var angularJs = function () {
.pipe(_concatenateAndUglify(config.pkg.name));
};

var angularTemplatesHeader = 'angular.module(\'cat.template\', [\'ui.bootstrap.tpls\']);\n';

var angularTemplates = function () {
return gulp.src('<%= paths.resources %>/**/*.html')
.pipe(gulp.sourcemaps.init())
.pipe(gulp.ngHtml2js({moduleName: 'cat.template', stripPrefix: 'resources/'}))
.pipe(_concatenateAndUglify(config.pkg.name + '.tpl'));
.pipe(gulp.ngHtml2js({moduleName: 'cat.template', stripPrefix: 'resources/', declareModule: false}))
.pipe(_concatenateAndUglify(config.pkg.name + '.tpl', angularTemplatesHeader));
};

var bowerJson = function () {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"gulp-filter": "=2.0.2",
"gulp-footer": "=1.0.5",
"gulp-git": "=1.1.0",
"gulp-header": "=1.2.2",
"gulp-header": "^1.2.2",
"gulp-jshint": "=1.9.0",
"gulp-less": "=1.3.6",
"gulp-ng-annotate": "=0.5.2",
Expand All @@ -53,7 +53,7 @@
"merge-stream": "=0.1.6",
"phantomjs": "=1.9.12",
"pretty-hrtime": "=1.0.0",
"rimraf": "=2.2.8",
"q": "=1.2.0"
"q": "=1.2.0",
"rimraf": "=2.2.8"
}
}

0 comments on commit e6c4547

Please sign in to comment.