diff --git a/Gruntfile.js b/Gruntfile.js index 9d7fe8c5c5..5f16949fc3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -349,24 +349,19 @@ module.exports = function(grunt) { } }, - devcode: { - options: { - html: true, // html files parsing? - js: true, // javascript files parsing? - css: false, // css 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 - close: 'endcode' // with this string we close a block of code - }, - dest: 'dist' // default destination which overwrittes environment variable - }, - dist : { // settings for task used with 'devcode:dist' + preprocess: { + + dist: { + src: ['dist/**/*.js','dist/**/*.html','dist/*.js','dist/*.html'], + dst: ['dist/'], options: { - source: 'dist/', - dest: 'dist/', - env: 'production' + inline: true, + context: { + DEBUG: false, + NODE_ENV: 'production' + } } + } }, @@ -425,7 +420,7 @@ module.exports = function(grunt) { // Default task(s). grunt.registerTask('default', ['clean', 'jshint', 'copy:dev']); - grunt.registerTask('prod', ['clean:dist', 'clean:server', 'compass:dist', 'copy:prod', 'copy:tests', 'concat', 'uglify:prod', 'devcode:dist', 'hashres','replace']); + grunt.registerTask('prod', ['clean:dist', 'clean:server', 'compass:dist', 'copy:prod', 'copy:tests', 'concat', 'uglify:prod', 'preprocess:dist', 'hashres', 'replace']); grunt.registerTask('dev', ['clean', 'compass:dev', 'copy:dev']); grunt.registerTask('test', ['karma']); grunt.registerTask('deploy', ['prod', 'gh-pages']); diff --git a/package.json b/package.json index a4ed6f697c..c733ffaa07 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "grunt-contrib-requirejs": "1.0.0", "grunt-contrib-uglify": "5.0.0", "grunt-contrib-watch": "1.1.0", - "grunt-devcode": "0.0.4", + "grunt-preprocess": "5.1.0", "grunt-gh-pages": "4.0.0", "grunt-hashres": "0.4.1", "grunt-html-validation": "0.1.18",