Can Grunt Lodash Templates Be Used In Gruntfile.js tasks?
问题 Is there a way to use grunt lodash templating in gruntfile.js tasks so I can use functions like .toLowerCase(). The below snippet doesn't work, maybe it doesn't work this way since I can't find an example that fits this use case. copy: { plugins: { files: [{ src: ['<%= root %>/<%= dirs.plugins %>/<%= pkg.name.toLowerCase() %>'], dest: '<%= root %>/<%= dirs.www %>/wp-content/plugins/<%= pkg.name %>', }] } } 回答1: Use the evaluate delimiter <% plus the String() constructor to use toLowerCase :