Minify templates and concat into one file.
This commit is contained in:
parent
3fa715298e
commit
5c568e649f
21
Gruntfile.js
21
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',
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
<script src="bower_components/underscore/underscore.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- build:js({.tmp,app}) scripts/scripts.js -->
|
||||
<!-- build:js(.tmp) scripts/templates.js -->
|
||||
<script src="scripts/templates.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- build:js scripts/scripts.js -->
|
||||
<script src="scripts/app.js"></script>
|
||||
<script src="scripts/libs.js"></script>
|
||||
<script src="scripts/config.js"></script>
|
||||
|
|
|
@ -4,7 +4,8 @@ angular.module('ffffng', [
|
|||
'ngSanitize',
|
||||
'ngRoute',
|
||||
'ng',
|
||||
'leaflet-directive'
|
||||
'leaflet-directive',
|
||||
'templates-main'
|
||||
])
|
||||
.config(function ($routeProvider) {
|
||||
$routeProvider
|
||||
|
|
4
app/scripts/templates.js
Normal file
4
app/scripts/templates.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Placeholder module for development. The real module holding the templates is generated via the html2js task.
|
||||
*/
|
||||
angular.module('templates-main', []);
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue