Use useref from the command line or in your npm scripts, because grunt and gulp shouldn't have all of the fun.
Install with npm
npm install useref-cli
Usage: useref <source file, directory, or pattern> <destination directory> [options]
Options:
-h, --help output usage information
-V, --version output the version number