Skip to content

Commit

Permalink
concatenate html templates
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Mar 7, 2015
1 parent 2654768 commit 9ebba5b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
11 changes: 11 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var sourcemaps = require('gulp-sourcemaps');
var debug = require('gulp-debug');
var mainBowerFiles = require('main-bower-files');
var gulpFilter = require('gulp-filter');
var templateCache = require('gulp-angular-templatecache');

var paths = {
sass: ['./scss/**/*.scss'],
Expand Down Expand Up @@ -46,6 +47,7 @@ gulp.task('watch', function () {
gulp.watch(paths.sass, ['sass']);
gulp.watch(paths.jsProject, ['js-concat-project']);
gulp.watch(paths.cssProject, ['css-concat-project']);
gulp.watch('www/templates/**/*.html', ['html-concat-templates']);
});

gulp.task('install', ['git-check'], function () {
Expand Down Expand Up @@ -76,6 +78,7 @@ gulp.task('build', function() {
gulp.start('css-concat-project');
gulp.start('css-concat-vendor');
gulp.start('fonts-concat-vendor');
gulp.start('html-concat-templates');
});


Expand Down Expand Up @@ -113,3 +116,11 @@ gulp.task('fonts-concat-vendor', function () {
.pipe(debug())
.pipe(gulp.dest('./www/fonts/'));
});

gulp.task('html-concat-templates', function() {
gulp.src('www/templates/**/*.html')
.pipe(templateCache({
module:'templatescache', standalone: true, root: './templates/'
}))
.pipe(gulp.dest('www/dist/'));
});
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "myapp",
"version": "1.0.0",
"description": "myApp: An Ionic project",
"dependencies": {
},
"devDependencies": {
"async": "^0.9.0",
"bower": "^1.3.3",
"cordova-minify": "0.0.12",
"gulp-util": "^2.2.14",
"jshint": "^2.6.3",
"shelljs": "^0.3.0",
"gulp-debug": "~2.0.1",
"gulp-sourcemaps": "~1.5.0",
"gulp-concat-vendor": "0.0.4",
"main-bower-files": "~2.5.0",
"gulp-filter": "~2.0.2",
"gulp": "^3.5.6",
"gulp-sass": "^0.7.1",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
}
"name": "myapp",
"version": "1.0.0",
"description": "myApp: An Ionic project",
"dependencies": {},
"devDependencies": {
"async": "^0.9.0",
"bower": "^1.3.3",
"cordova-minify": "0.0.12",
"gulp": "^3.5.6",
"gulp-angular-templatecache": "^1.5.0",
"gulp-concat": "^2.2.0",
"gulp-concat-vendor": "0.0.4",
"gulp-debug": "~2.0.1",
"gulp-filter": "~2.0.2",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^0.7.1",
"gulp-sourcemaps": "~1.5.0",
"gulp-util": "^2.2.14",
"jshint": "^2.6.3",
"main-bower-files": "~2.5.0",
"shelljs": "^0.3.0"
}
}
1 change: 1 addition & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="dist/templates.js"></script>
<script src="dist/project.js"></script>
</head>
<body ng-app="starter">
Expand Down
2 changes: 1 addition & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'templatescache'])

.run(['$ionicPlatform', '$window', function ($ionicPlatform, $window) {
$ionicPlatform.ready(function () {
Expand Down

0 comments on commit 9ebba5b

Please sign in to comment.