Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Gulp Watch doesn't work - Episode II
Dear all,
I have noticed that for some people it works while it doesn't work for some others. Someone has even built his own binary to automatically build and deploy...
I am using Liferay 7.1 GA2 (Community) and my gulp watch doesn't work as you have already understood. I am using Linux, Ubuntu 18. Last time I opened a ticket for this issue, it was Liferay 7 using Windows, 2 years ago and it worked at the end of the day. Now back to Episode II :)
Status is the following:
- gulp build works --> GOOD
- gulp deploy works --> GOOD
- gulp watch partially works, when starting it correctly deploys
more package.json<br> {<br> "devDependencies":
{<br> "gulp": "3.9.1",<br>
"liferay-theme-deps-7.1": "8.0.0-rc.1",<br>
"liferay-theme-tasks":
"^8.0.0-rc.1"<br> },<br> "keywords":
[<br> "liferay-theme"<br> ],<br>
"liferayTheme": {<br> "baseTheme":
"styled",<br> "screenshot":
"",<br> "rubySass": false,<br>
"templateLanguage": "ftl",<br>
"version": "7.1"<br> },<br>
"main": "package.json",<br>
"name": "custom-theme",<br>
"version": "1.0.0"<br> }
more liferay-theme.json<br> {<br>
"LiferayTheme": {<br> "deployPath":
"path_to_liferay_home/deploy",<br>
"themeName": "custom-theme",<br>
"appServerPathTheme":
"path_to_liferay_home/tomcat-9.0.10/webapps/custom-theme",<br>
"deployed": true,<br> "appServerPath":
"path_to_liferay_home/tomcat-9.0.10",<br>
"appServerPathPlugin":
"path_to_liferay_workspace/themes/custom-theme/.web_bundle_build",<br>
"deploymentStrategy":
"LocalAppServer",<br> "url":
"http://localhost:8080",<br> "pluginName":
"custom-theme",<br> "webBundleDir":
"watching",<br> "changedFile": {<br>
"type": "changed",<br>
"path":
"path_to_liferay_workspace/themes/custom-theme/src/css/_custom_lastBlogs.scss"<br>
}<br> }<br> }
When modifying a file, I have
[19:20:41] Starting 'build:clean'...<br> [19:20:42] Finished
'build:clean' after 143 ms<br> [19:20:42] Starting
'build:base'...<br> [19:20:42] Finished 'build:base' after 465
ms<br> [19:20:42] Starting 'build:src'...<br> [19:20:42]
Finished 'build:src' after 18 ms<br> [19:20:42] Starting
'build:themelet-src'...<br> [19:20:42] Finished
'build:themelet-src' after 32 μs<br> [19:20:42] Starting
'build:themelet-css-inject'...<br> [19:20:42] gulp-inject Nothing
to inject into _custom.scss.<br> [19:20:42] Finished
'build:themelet-css-inject' after 3.87 ms<br> [19:20:42] Starting
'build:rename-css-dir'...<br> [19:20:42] Finished
'build:rename-css-dir' after 76 μs<br> [19:20:42] Starting
'build:compile-css'...<br> [19:20:42] Starting
'build:compile-lib-sass'...<br> [19:20:43] Finished
'build:compile-lib-sass' after 900 ms<br> [19:20:43] Finished
'build:compile-css' after 900 ms<br> [19:20:43] Starting
'build:move-compiled-css'...<br> [19:20:43] Finished
'build:move-compiled-css' after 131 ms<br> [19:20:43] Starting
'build:remove-old-css-dir'...<br> [19:20:43] Finished
'build:remove-old-css-dir' after 20 ms
The modified file is not propagated to the
.web_bundle_build
so I assume this is where something
goes wrong.
What am I doing wrong ?
Thank you in advance for your help,
Hi Eric. It's unlikely that you are doing anything wrong as there are some known issues with `gulp watch`. We've seen instances where a back-end error gets thrown after redeploying via the GoGo shell, and this is very hard to do anything about from the liferay-themes-sdk, which is operating outside the server.
So at the moment we are exploring alternatives — such as a Webpack-based solution — that allow changes to be picked up without going through the GoGo shell. This will almost certainly work for CSS changes, and we'll see if it can be made to work for other changes made in themes as well. As we make progress we'll be updating this GitHub ticket in the liferay-themes-sdk repo.
Powered by Liferay™