liferay / liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18 stars 24 forks source link

main.css and aui.css 404 #82

Closed croucha closed 6 years ago

croucha commented 6 years ago

I've figured out what must be done to recursively watch files. Will branch and make merge request.

Strangest thing,

When I use the plugin with the following command: gulp deploy, the war is made and the theme works fine. However, when I use the command: gulp watch and I make a UI change. I go to refresh the site with the theme in the browser and I get 404's on aui.css and main.css. They seem to be literally missing.

The server log looks fine and so does the log for gulp. I have included pictures below. I also have the include-and-override=portal-developer.properties on.. I do notice folders appearing in temp and then vanishing immediately afterwards but I figured that is part of OSGI.

Update: I discovered this isn't an issue when I change a UI file within src/js. However, if I have a UI file, let's say under a different folder like src/assets/js, then it breaks with the 404 on main and aui css.

As I dig further into your code, it appears that this setup works best when making changes to the js/css/images/templates directories under src. It expects a certain directory structure to work. Since I added this custom assets directory with files, it detects changes, but doesn't update just the one file. It goes through another deploy and breaks with the main.css and aui.css missing. Is there someway it can be made to recursively look through the src/ directory for any changes and only apply it to the specific file that has changed?

I could be wrong but I think changes to this:

https://github.com/liferay/liferay-theme-tasks/blob/master/tasks/watch.js

on line 34 would fix the issue. You specify only to sniff under images/js. How about just sniffing under src?

image

image

croucha commented 6 years ago

I have created a pull request that should hopefully solve this issue. Waiting for review by Liferay to get it merged in...

https://github.com/liferay/liferay-theme-tasks/pull/84