Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 077defc

Browse files
committed
Fix #3479 Move from grunt-devcode to grunt-preprocessor (#3479)
1 parent fc33b0d commit 077defc

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

Gruntfile.js

+12-17
Original file line numberDiff line numberDiff line change
@@ -349,24 +349,19 @@ module.exports = function(grunt) {
349349
}
350350
},
351351

352-
devcode: {
353-
options: {
354-
html: true, // html files parsing?
355-
js: true, // javascript files parsing?
356-
css: false, // css files parsing?
357-
clean: true, // removes devcode comments even if code was not removed
358-
block: {
359-
open: 'devcode', // with this string we open a block of code
360-
close: 'endcode' // with this string we close a block of code
361-
},
362-
dest: 'dist' // default destination which overwrittes environment variable
363-
},
364-
dist : { // settings for task used with 'devcode:dist'
352+
preprocess: {
353+
354+
dist: {
355+
src: ['dist/**/*.js','dist/**/*.html','dist/*.js','dist/*.html'],
356+
dst: ['dist/'],
365357
options: {
366-
source: 'dist/',
367-
dest: 'dist/',
368-
env: 'production'
358+
inline: true,
359+
context: {
360+
DEBUG: false,
361+
NODE_ENV: 'production'
362+
}
369363
}
364+
370365
}
371366
},
372367

@@ -425,7 +420,7 @@ module.exports = function(grunt) {
425420

426421
// Default task(s).
427422
grunt.registerTask('default', ['clean', 'jshint', 'copy:dev']);
428-
grunt.registerTask('prod', ['clean:dist', 'clean:server', 'compass:dist', 'copy:prod', 'copy:tests', 'concat', 'uglify:prod', 'devcode:dist', 'hashres','replace']);
423+
grunt.registerTask('prod', ['clean:dist', 'clean:server', 'compass:dist', 'copy:prod', 'copy:tests', 'concat', 'uglify:prod', 'preprocess:dist', 'hashres', 'replace']);
429424
grunt.registerTask('dev', ['clean', 'compass:dev', 'copy:dev']);
430425
grunt.registerTask('test', ['karma']);
431426
grunt.registerTask('deploy', ['prod', 'gh-pages']);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"grunt-contrib-requirejs": "1.0.0",
2222
"grunt-contrib-uglify": "5.0.0",
2323
"grunt-contrib-watch": "1.1.0",
24-
"grunt-devcode": "0.0.4",
24+
"grunt-preprocess": "5.1.0",
2525
"grunt-gh-pages": "4.0.0",
2626
"grunt-hashres": "0.4.1",
2727
"grunt-html-validation": "0.1.18",

0 commit comments

Comments
 (0)