Skip to content

Commit 1e4c989

Browse files
committed
Fixed caching AngularJS templates.
1 parent b7b7da7 commit 1e4c989

5 files changed

Lines changed: 19 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.2.1 (2014-02-16)
2+
3+
## Bug Fixes
4+
5+
- **watch:**
6+
- fixed caching AngularJS templates
7+
18
# 0.2.0 (2014-02-15)
29

310
## Features

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ng-devstack v0.2.0
1+
# ng-devstack v0.2.1
22

33
#### Everything a front-end developer needs to simplify building AngularJS applications.
44

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-devstack",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"devDependencies": {
55
"angular": "~1.2.12",
66
"angular-bootstrap": "~0.10.0",

gulpfile.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ var fnInject = function (path) {
149149
return gulp.src(inject.css.concat(inject.js), { read: false })
150150
.pipe(plugins.inject(path, {
151151
addRootSlash: false,
152-
ignorePath: ['/', 'build/']
152+
ignorePath: ['/', config.build + '/']
153153
}))
154154
.pipe(gulp.dest(config.build));
155155
};
@@ -184,6 +184,7 @@ gulp.task('html', ['html:replace'], function () {
184184
gulp.task('watch', ['styles:sass', 'scripts:lint', 'scripts:html2js', 'assets:img', 'vendor:js', 'vendor:assets', 'html:inject'], function () {
185185
require('./server.js')(server);
186186

187+
// watch for JS changes
187188
gulp.watch(config.paths.scripts, function (event) {
188189
if (event.path.lastIndexOf('.js') === event.path.length - 3) {
189190
if (event.type === 'deleted') {
@@ -197,16 +198,20 @@ gulp.task('watch', ['styles:sass', 'scripts:lint', 'scripts:html2js', 'assets:im
197198
});
198199

199200
// remove deleted JS files from index.html
200-
gulp.watch('build/+(app|common)/**/*.js', function (event) {
201+
gulp.watch(config.build + '/+(app|common)/**/*.js', function (event) {
201202
if (event.type !== 'changed') {
202203
return fnInject(config.paths.html).pipe(plugins.livereload(server));
203204
}
204205
});
205206

206-
gulp.watch(config.paths.templates, function (event) {
207-
return fnHtml2Js(config.paths.templates).pipe(plugins.livereload(server));
207+
// watch AngularJS templates to cache
208+
gulp.watch(config.app + '/+(app|common)/**', function (event) {
209+
if (event.path.lastIndexOf('.tpl.html') === event.path.length - 9) {
210+
return fnHtml2Js(config.paths.templates).pipe(plugins.livereload(server));
211+
}
208212
});
209213

214+
// watch for SASS changes
210215
gulp.watch(config.paths.sass, function (event) {
211216
if (event.path.lastIndexOf('.scss') === event.path.length - 5) {
212217
var files = [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Mariusz Michalski",
33
"name": "ng-devstack",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"licenses": {
66
"type": "MIT",
77
"url": "https://raw2.github.com/mariuszm/ng-devstack/master/LICENSE.md"

0 commit comments

Comments
 (0)