Ember-CLI: watch additional directory for changes

Hi,

I’m writing an addon that provides some special kind of mock server which reads the data from a directory in the app using the addon ( path.join(this.project.root, 'my-server-directory'); in index.js). This works fine except for one thing: Changed files in my special server should trigger a server restart.

How can I add this additional directory to the watched directories auf ember-cli?

Cheers, -jnf

If it’s under the app directory it should work. Are you using watchman or node-watcher? I’m using the watchman; have just tested that anything under app, except in tmp, triggers a reload.

If it’s under the app directory it should work.

Yes. But it’s not part of the app and should not be packed for the client. I could use server as well and put a dummy index.js in there. That would be closer to the truth (I’m doing something like the mock server, only with some additional magic).Both are hacks that would work, but wouldn’t feel right. Therefore my question, how I can add a directory to be watched for server restart. If that’s not (easily) possible I’ll have to put my directory as sub-directory under an already watched one.

Are you using watchman or node-watcher?

It’s a windows build, whatever’s used there by default. Anyway, watching of files per se is working.

Cheers, -jnf

Sorry, i misunderstood. I’m afraid that broccoli is still a bit of a mystery to me; I don’t know how you can add other directories to the watch list.

Thanks anyway. :slight_smile:

For further reference: Somewhere else Stefan Penner said that this isn’t currently possible.