diff --git a/Gruntfile.js b/Gruntfile.js index 9745afc..bfbabc0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,6 +19,7 @@ module.exports = function(grunt) { html: true, js: true, css: true, + php: true, clean: true, block: { open: 'devcode', diff --git a/README.md b/README.md index 62b0410..17a83f8 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Little watch task (livereload section) change: files: [ '<%= yeoman.app %>/{,*/}*.html', '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css', + '{.tmp,<%= yeoman.app %>}/{,*/}*.php', '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js', '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg}' ], @@ -77,6 +78,7 @@ Build task configuration html: true, // html files parsing? js: true, // javascript files parsing? css: true, // css files parsing? + php: true, // php files parsing? clean: true, // removes devcode comments even if code was not removed block: { open: 'devcode', // with this string we open a block of code @@ -110,7 +112,7 @@ Devcode usage (html files): this code will show for all environment types but production ``` -Devcode usage (js and css files): +Devcode usage (js, css and php files): ``` // devcode: !production body { diff --git a/tasks/devcode.js b/tasks/devcode.js index ad8ace9..f5115a7 100644 --- a/tasks/devcode.js +++ b/tasks/devcode.js @@ -42,7 +42,7 @@ function init(grunt) var startblock = ''; var endblock = ''; } - else if ( type == 'js' || type == 'css' ) + else if ( type == 'js' || type == 'css' || type == 'php' ) { var startblock = '\/\/\\s*'+cOpen+':\\s*?([^\\n]+)'; var endblock = '\/\/\\s*'+cClose+'\\s*'; @@ -106,5 +106,9 @@ function init(grunt) { replaceCode(grunt.file.expand({cwd: srcDir, filter : "isFile"},'**/*.css'), 'css'); } + if ( options.php == true ) + { + replaceCode(grunt.file.expand({cwd: srcDir, filter : "isFile"},'**/*.php'), 'php'); + } }); };