The grunt-json-minify
(as indicated in user2806181's answer) works OK (thanks, by the way), but it only modifies files in place. Inspired by the answer, I've found one that's a bit more advanced: grunt-minjson:
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
minjson: {
build: {
files: {
'target/locales/en/messages.json':
'resource/locales/en/messages.json'
}
}
}
});