Using Grunt.js, I need to read filenames of a series of JavaScript files in a directory, and insert part of each name into each of the files. I'm not finding a Grunt task that lets me do this.
So if my filename is someFileName.js
, I would want the beginning of the file to look like:
var someFileName = ...
What is a simple way to do this?
grunt-string-replace appears to have what I need in recent release 1.3.0:
Inject src and dest into the callback function when replacement is a function; this allows the replacement function to use the old and/or new file paths/names for further processing
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.