diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index 966b3fc..f6968e6 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -21,23 +21,26 @@ module.exports = function (grunt) { yeoman: { // configurable paths app: 'app', + scripts: 'scripts', + styles: 'styles', + images: 'images' }, // Watches files for changes and runs tasks based on the changed files watch: { js: { - files: ['<%%= yeoman.app %>/scripts/**/*.js'], + files: ['<%%= yeoman.app %>/<%%= yeoman.scripts %>/**/*.js'], tasks: ['newer:jshint:all'], options: { livereload: true } },<% if (compass) { %> compass: { - files: ['<%%= yeoman.app %>/styles/**/*.{scss,sass}'], + files: ['<%%= yeoman.app %>/<%%= yeoman.styles %>/**/*.{scss,sass}'], tasks: ['compass:server', 'autoprefixer'] },<% } else { %> styles: { - files: ['<%%= yeoman.app %>/styles/**/*.css'], + files: ['<%%= yeoman.app %>/<%%= yeoman.styles %>/**/*.css'], tasks: ['newer:copy:styles', 'autoprefixer'] },<% } %> gruntfile: { @@ -50,8 +53,8 @@ module.exports = function (grunt) { files: [ '<%%= yeoman.app %>/*.html', '<%%= yeoman.app %>/templates/**/*.html', - '.tmp/styles/**/*.css', - '<%%= yeoman.app %>/images/**/*.{png,jpg,jpeg,gif,webp,svg}' + '.tmp/<%%= yeoman.styles %>/**/*.css', + '<%%= yeoman.app %>/<%%= yeoman.images %>/**/*.{png,jpg,jpeg,gif,webp,svg}' ] } }, @@ -95,7 +98,7 @@ module.exports = function (grunt) { }, all: [ 'Gruntfile.js', - '<%%= yeoman.app %>/scripts/**/*.js' + '<%%= yeoman.app %>/<%%= yeoman.scripts %>/**/*.js' ], test: { options: { @@ -127,9 +130,9 @@ module.exports = function (grunt) { dist: { files: [{ expand: true, - cwd: '.tmp/styles/', + cwd: '.tmp/<%%= yeoman.styles %>/', src: '{,*/}*.css', - dest: '.tmp/styles/' + dest: '.tmp/<%%= yeoman.styles %>/' }] } }, @@ -146,16 +149,16 @@ module.exports = function (grunt) { // Compiles Sass to CSS and generates necessary files if requested compass: { options: { - sassDir: '<%%= yeoman.app %>/styles', - cssDir: '.tmp/styles', + sassDir: '<%%= yeoman.app %>/<%%= yeoman.styles %>', + cssDir: '.tmp/<%%= yeoman.styles %>', generatedImagesDir: '.tmp/img/generated', imagesDir: '<%%= yeoman.app %>/img', - javascriptsDir: '<%%= yeoman.app %>/scripts', - fontsDir: '<%%= yeoman.app %>/styles/fonts', + javascriptsDir: '<%%= yeoman.app %>/<%%= yeoman.scripts %>', + fontsDir: '<%%= yeoman.app %>/<%%= yeoman.styles %>/fonts', importPath: '<%%= yeoman.app %>/bower_components', httpImagesPath: '/img', httpGeneratedImagesPath: '/img/generated', - httpFontsPath: '/styles/fonts', + httpFontsPath: '/<%%= yeoman.styles %>/fonts', relativeAssets: false, assetCacheBuster: false, raw: 'Sass::Script::Number.precision = 10\n' @@ -195,7 +198,7 @@ module.exports = function (grunt) { // Performs rewrites based on the useminPrepare configuration usemin: { html: ['www/**/*.html'], - css: ['www/styles/**/*.css'], + css: ['www/<%%= yeoman.styles %>/**/*.css'], options: { assetsDirs: ['www'] } @@ -242,15 +245,15 @@ module.exports = function (grunt) { ] }, { expand: true, - cwd: '.tmp/images', - dest: 'www/images', + cwd: '.tmp/<%%= yeoman.images %>', + dest: 'www/<%%= yeoman.images %>', src: ['generated/*'] }] }, styles: { expand: true, - cwd: '<%%= yeoman.app %>/styles', - dest: '.tmp/styles/', + cwd: '<%%= yeoman.app %>/<%%= yeoman.styles %>', + dest: '.tmp/<%%= yeoman.styles %>/', src: '{,*/}*.css' }, fonts: { @@ -262,7 +265,7 @@ module.exports = function (grunt) { vendor: { expand: true, cwd: '<%%= yeoman.app %>/vendor', - dest: '.tmp/styles/', + dest: '.tmp/<%%= yeoman.styles %>/', src: '{,*/}*.css' }, all: { @@ -300,9 +303,9 @@ module.exports = function (grunt) { // cssmin: { // dist: { // files: { - // 'www/styles/main.css': [ - // '.tmp/styles/**/*.css', - // '<%%= yeoman.app %>/styles/**/*.css' + // 'www/<%%= yeoman.styles %>/main.css': [ + // '.tmp/<%%= yeoman.styles %>/**/*.css', + // '<%%= yeoman.app %>/<%%= yeoman.styles %>/**/*.css' // ] // } // } @@ -310,8 +313,8 @@ module.exports = function (grunt) { // uglify: { // dist: { // files: { - // 'www/scripts/scripts.js': [ - // 'www/scripts/scripts.js' + // 'www/<%%= yeoman.scripts %>/scripts.js': [ + // 'www/<%%= yeoman.scripts %>/scripts.js' // ] // } // } @@ -327,7 +330,7 @@ module.exports = function (grunt) { configFile: 'karma.conf.js', reporters: ['dots', 'coverage'], preprocessors: { - 'app/scripts/**/*.js': ['coverage'] + 'app/<%%= yeoman.scripts %>/**/*.js': ['coverage'] }, coverageReporter: { reporters: [ @@ -355,9 +358,9 @@ module.exports = function (grunt) { dist: { files: [{ expand: true, - cwd: '.tmp/concat/scripts', + cwd: '.tmp/concat/<%%= yeoman.scripts %>', src: '*.js', - dest: '.tmp/concat/scripts' + dest: '.tmp/concat/<%%= yeoman.scripts %>' }] } } @@ -423,7 +426,7 @@ module.exports = function (grunt) { // we don't have to run the karma test server as part of `grunt serve` grunt.registerTask('watch:karma', function () { var karma = { - files: ['<%%= yeoman.app %>/scripts/**/*.js', 'test/spec/**/*.js'], + files: ['<%%= yeoman.app %>/<%%= yeoman.scripts %>/**/*.js', 'test/spec/**/*.js'], tasks: ['newer:jshint:test', 'karma:unit:run'] }; grunt.config.set('watch', karma);