4

I'm using pub serve to run my page. I noticed that there are tools like lite-server for npm, that make sure that after file contents are changed, the web page is automatically refreshed.

Anyone got something like that working for dart using pub serve? I thought maybe some grinder script with the watcher package could make that work?

Kasper
  • 12,594
  • 12
  • 41
  • 63

1 Answers1

1

Pub should handle monitoring and autodeployment of changes itself when run in debug or release mode.

You can verify this works correctly by issuing from your project root

pub serve

then make a change to a html or dart file and verify that the project is automatically rebuilt.

If this is not working, you might try experimenting with the --force-poll option when running pub serve. Per documentation:

--[no-]force-poll    Force the use of a polling filesystem watcher.
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
ilikerobots
  • 787
  • 6
  • 16
  • 1
    This doesn't update the browser. `pub serve` would need integration with autoreload. – Günter Zöchbauer Jan 11 '16 at 18:44
  • Yes, it does rebuild, but I basically, want that the browser refreshes automatically after rebuilding. – Kasper Jan 11 '16 at 22:01
  • Ok, I understand now. What browser/client are you using? If Dartium/Chrome, see this question, it may help: http://stackoverflow.com/questions/14512014/automatically-refresh-page-when-dart-source-files-change – ilikerobots Jan 12 '16 at 07:33