Essaye Fb-Flo de Facebook
https://github.com/facebook/fb-flo#usage
Un Tutoriel :
http://www.grafikart.fr/tutoriels/html-css/fb-flo-reload-516
Exemple :
“Flo.js” à la racine du projet Rails.
var flo = require('fb-flo'),
path = require('path'),
fs = require('fs');
var server = flo(
'./',
{
port: 8888,
host: 'localhost',
verbose: false,
glob: [
// All JS files in `sourceDirToWatch` and subdirectories
'**/*.js',
// All CSS files in `sourceDirToWatch` and subdirectories
'**/*.css',
'**/*.html.erb'
]
},
function resolver(filepath, callback) {
console.log(filepath+" a ete modifie");
// 1. Call into your compiler / bundler.
// 2. Assuming that `bundle.js` is your output file, update `bundle.js`
// and `bundle.css` when a JS or CSS file changes.
callback({
resourceURL: '/',
// any string-ish value is acceptable. i.e. strings, Buffers etc.
reload:true,
contents: fs.readFileSync(filepath),
update: function(_window, _resourceURL) {
// this function is executed in the browser, immediately after the resource has been updated with new content
// perform additional steps here to reinitialize your application so it would take advantage of the new resource
console.log("Resource " + _resourceURL + " has just been updated with new content");
//location.reload();
}
});
}
);
et côté chrome la configuration que j’avais rentré si je me souviens bien c’est .
0.0.0.0
localhost
8888
Et voila. Je ne connais pas les autres solutions sauf guard que j’ai testé et fait fonctionné un temps juste pour compiler pour le coffee et le sass.