When using two static path (calling to times instant(...)) only the first path is watched for file modification.
Here is a server sample
'use strict';
var express = require('express');
var app = module.exports = express();
var path = require('path');
var clientPath = path.resolve(__dirname, '../');
var instant = require('instant');
app.use( instant( clientPath + '/lib' ) );
app.use( instant( clientPath + '/demo' ) );
app.start = function(port) {
// start the web server
return app.listen(port,function() {
console.log('Web server listening at: %s', port);
});
};
// start the server if `$ node server.js`
if (require.main === module) {
app.start(3000);
}
The folder structure is:
/demo
index.html
app.js
server.js
/lib
lib-file.js
files from lib folder are watched but not from demo.
If you call in reverse order
app.use( instant( clientPath + '/demo' ) );
app.use( instant( clientPath + '/lib' ) );
then files from demo are watched but not from lib
When using two static path (calling to times instant(...)) only the first path is watched for file modification.
Here is a server sample
The folder structure is:
files from lib folder are watched but not from demo.
If you call in reverse order
then files from demo are watched but not from lib