diff --git a/Gruntfile.js b/Gruntfile.js index 06cd5e3..7df714c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -182,6 +182,26 @@ module.exports = function (grunt) { } }, + html2js: { + options: { + base: 'app', + htmlmin: { + collapseBooleanAttributes: true, + collapseWhitespace: true, + removeAttributeQuotes: true, + removeComments: true, + removeEmptyAttributes: true, + removeRedundantAttributes: true, + removeScriptTypeAttributes: true, + removeStyleLinkTypeAttributes: true + } + }, + main: { + src: ['<%= yeoman.app %>/views/{*,**/*}.html'], + dest: '.tmp/scripts/templates.js' + } + }, + // Renames files for browser caching purposes rev: { dist: { @@ -396,6 +416,7 @@ module.exports = function (grunt) { grunt.registerTask('build', [ 'clean:dist', 'bowerInstall', + 'html2js', 'useminPrepare', 'concurrent:dist', 'autoprefixer', diff --git a/app/index.html b/app/index.html index 9165ef6..f706507 100644 --- a/app/index.html +++ b/app/index.html @@ -34,7 +34,11 @@ - + + + + + diff --git a/app/scripts/app.js b/app/scripts/app.js index ecaf090..50bbc81 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -4,7 +4,8 @@ angular.module('ffffng', [ 'ngSanitize', 'ngRoute', 'ng', - 'leaflet-directive' + 'leaflet-directive', + 'templates-main' ]) .config(function ($routeProvider) { $routeProvider diff --git a/app/scripts/templates.js b/app/scripts/templates.js new file mode 100644 index 0000000..e231e66 --- /dev/null +++ b/app/scripts/templates.js @@ -0,0 +1,4 @@ +/** + * Placeholder module for development. The real module holding the templates is generated via the html2js task. + */ +angular.module('templates-main', []); diff --git a/package.json b/package.json index 6742139..75fb014 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-watch": "~0.5.2", "grunt-develop": "~0.4.0", + "grunt-html2js": "~0.2.7", "grunt-newer": "~0.6.1", "grunt-ngmin": "~0.0.2", "grunt-rev": "~0.1.0",