How to automatically reload changes HTML/CSS after "Run on Worklight Dev Server"?

687 Views Asked by At

I have a hybrid Worklight app and every time I change the HTML code I have to delete the app from Admin Console, Clean from Eclipse, clear Chrome browsing data and redeploy.

How can I automatically make WL reload the HTML changes every time I redeploy a WL environment (no more remove from Console or Clean from Eclipse)?

2

There are 2 best solutions below

4
On BEST ANSWER

My first response is: huh?
You are totally not supposed to do this...

Starting Worklight 6.1, after a change in any of an application's web resources (HTML, JS, CSS, images, ...), after the initial deployment of the app (Run As > Run on Worklight Development Server) you no longer even need to re-build the app.

When you preview the app via Worklight Console, all you need to do is to refresh the browser window. That's it.

You most definitely should not delete the app from Worklight Console or "Clean from Eclipse".

That said, if you are talking about previewing the "Common web resources" option in Worklight Console, what you may want to do (hopefully as a one-time action) is to:

  1. Close Eclipse
  2. Locate your temp folder (Windows, OS X)
  3. Delete the wlBuildResources folder (optionally wlPreview folder as well)
  4. Open Eclipse
  5. Re-build

Should work.

1
On

Now that that's fixed you can click the Go/Refresh Button of the simulator to utilize the "instant preview" feature during development.

Go/Refresh Button