Aurelia-cli plugin watch

I’m using the latest aurelia-cli (1.2.2). I’ve run au new --plugin which has built out an aurelia app setup for plugin development. It builds and runs fine. The issue I’m seeing though is that “watching” functionality is not rebuilding like the normal au new app where au run will run the app and refresh on any code changes. This only seems to happen with creating a new plugin. Any ideas? I’ve also tried au new --watch but I still am required to rerun au run in order to see any code changes within the src or dev-app folder.

1 Like

Did you mean au run --watch or au new --watch?

1 Like

If you store your project in docker or vagrant, the chokidar (gulp watcher uses) cannot detect file changes.

Update aurelia_project/tasks/watch.js to use polling.


let watchPath = (p) => {
  gulpWatch(
    p,
    {
      usePolling: true,
      read: false, // performance optimization: do not read actual file contents
      verbose: true
    },
    (vinyl) => processChange(vinyl));
};
1 Like

Sorry…yes I mean’t au run

1 Like

OK then. Did you try what huochunpeng suggested above? Regardless of whether you’re running on a mounting filesystem without inotify, you can always set usePolling: true.

1 Like

Sorry I wasn’t clear with my original question. I was just noting that browser-sync wasn’t working properly with a CLI built app using the standard au run. I usually come up with my own npm run scripts anyways and had done so with this app as well. I was only noting this as something I noticed with the lastest CLI and posted this to see if any others had noticed this as well. I wasn’t able to figure out why it wouldn’t work with just au run and from what I can see, everything is running so figured it might be do to a browser-sync version issue or even just my computer. I was running this within my OneDrive folder and remembered today that I’ve had issues with permission in the past so that may be it.

2 Likes