diff --git a/Gruntfile.js b/Gruntfile.js index cdb5b91f3..1ed341f9c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,23 +1,17 @@ /* eslint-env node */ module.exports = function ( grunt ) { - const messagesDirs = grunt.file.readJSON( 'extension.json' ).MessagesDirs; - - const subExtensions = [ + const messagesDirs = require( './extension.json' ).MessagesDirs; + for ( const subExtension of [ 'QuestyCaptcha', 'ReCaptchaNoCaptcha', 'FancyCaptcha', 'MathCaptcha', 'hCaptcha' - ]; - - subExtensions.forEach( - function ( subExtension ) { - messagesDirs[ subExtension ] = grunt.file.readJSON( subExtension + '/extension.json' ).MessagesDirs[ subExtension ].map( - function ( path ) { - return subExtension + '/' + path; - } - ); - } ); + ] ) { + messagesDirs[ subExtension ] = require( './' + subExtension + '/extension.json' ) + .MessagesDirs[ subExtension ] + .map( function ( path ) { return subExtension + '/' + path; } ); + } grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-eslint' );