diff --git a/templates/common/root/_Gruntfile.js b/templates/common/root/_Gruntfile.js index 361a5d4f7..62ab06307 100644 --- a/templates/common/root/_Gruntfile.js +++ b/templates/common/root/_Gruntfile.js @@ -38,10 +38,17 @@ module.exports = function (grunt) { coffeeTest: { files: ['test/spec/{,*/}*.{coffee,litcoffee,coffee.md}'], tasks: ['newer:coffee:test', 'karma'] + }, + jsdocs: { + files: ['.tmp/scripts/{,*/}*.js'], + tasks: ['ngdocs'], + options: { + livereload: true + } },<% } else { %> js: { files: ['<%%= yeoman.app %>/scripts/{,*/}*.js'], - tasks: ['newer:jshint:all'], + tasks: ['ngdocs', 'newer:jshint:all'], options: { livereload: '<%%= connect.options.livereload %>' } @@ -67,8 +74,7 @@ module.exports = function (grunt) { }, files: [ '<%%= yeoman.app %>/{,*/}*.html', - '.tmp/styles/{,*/}*.css',<% if (coffee) { %> - '.tmp/scripts/{,*/}*.js',<% } %> + '.tmp/styles/{,*/}*.css', '<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' ] } @@ -392,6 +398,16 @@ module.exports = function (grunt) { cwd: '<%%= yeoman.app %>/styles', dest: '.tmp/styles/', src: '{,*/}*.css' + }, + ngdocs: { + expand: true, + cwd: '<%%= yeoman.app %>/docs', + dest: '.tmp/docs/', + src: [ + '*.{ico,png,txt}', + '.htaccess', + '*.html', + ] } }, @@ -422,6 +438,13 @@ module.exports = function (grunt) { configFile: 'karma.conf.js', singleRun: true } + }, + ngdocs: { + options: { + dest: '.tmp/docs', + html5Mode: false + }, + api: ['<% if (coffee) { %>.tmp<% } else { %><%%= yeoman.app %><% } %>/scripts/{,*/}*.js'], } }); @@ -436,6 +459,7 @@ module.exports = function (grunt) { 'wiredep', 'concurrent:server', 'autoprefixer', + 'ngdocs', 'connect:livereload', 'watch' ]); @@ -462,6 +486,7 @@ module.exports = function (grunt) { 'autoprefixer', 'concat', 'ngmin', + 'ngdocs', 'copy:dist', 'cdnify', 'cssmin', diff --git a/templates/common/root/_package.json b/templates/common/root/_package.json index c38ae2dfb..e35d31fbc 100644 --- a/templates/common/root/_package.json +++ b/templates/common/root/_package.json @@ -25,6 +25,7 @@ "grunt-svgmin": "^0.4.0", "grunt-usemin": "^2.1.1", "grunt-wiredep": "^1.7.0", + "grunt-ngdocs": "^0.2.2", "jshint-stylish": "^0.2.0", "load-grunt-tasks": "^0.4.0", "time-grunt": "^0.3.1"