Kasper
Kasper

Reputation: 13622

Automatic refresh the page when changes while running pub serve (dart)

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?

Upvotes: 4

Views: 603

Answers (1)

ilikerobots
ilikerobots

Reputation: 787

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.

Upvotes: 1

Related Questions