You can use Bower hooks to manipulate file modification time. This is a kind of hack, but you can achieve what you are looking for.
You will need to register the postinstall hook and pass the list of updated components as an argument. When the script is called,% will be replaced by a space-separated list of components that will be installed or removed.
Hooks must be registered in the .bowerrc file:
{ "scripts": { "postinstall": "hook.sh %" } }
Then you need a script that iterates over the components and changes the file modification time.
For example, a shell script:
#!/bin/bash for var in " $@ " do find "./bower_components/$var" -exec touch {} \; done
Here is another example node.js script for the same purpose:
var fs = require('fs'); var path = require('path') var components = process.argv.slice(2) components.forEach(function (comp) { var comp_path = path.join(process.cwd(),"bower_components",comp); var files = fs.readdirSync(comp_path); files.forEach(function(file) { fs.utimesSync(path.join(comp_path, file), new Date(), new Date()); }); });
source share