PDA

View Full Version : Build both desktop and phone for universal app?



pauldugas
1 Aug 2019, 3:18 PM
I'm not new to ExtJS but I haven't build a universal app before so I'm tinkering with doing so using the recent 7-EA release. I used the "universalmodern" template so the resulting package.json has scripts entries for "build:desktop" and "build:phone" and the index.html has logic to set Ext.manifest to point to generatedFiles/desktop or generatedFiles/phone.

However, when I run either of those builds, build/production/MyApp ony has the one version of the app. I expected there to be a way to build both and deploy them together.

What am I missing? Do I have to combine them myself?

rakumar
8 Aug 2019, 11:13 AM
Hello Paul,

No there is no need to combine it by yourself, because it is already combined. Based on the desktop or phone it will switch to the corresponding build.
You can build the universal app like any other app created on extjs or by command "sencha app build".


For more details please see the below documentation.
https://docs.sencha.com/extjs/6.0.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_universal_applications_and_smart_phones


Regards,
Kumar
Sencha Support.

pauldugas
8 Aug 2019, 1:24 PM
Got it. What are the "dev:*" and "build:*" scripts in package.json for then? I was running those, not the sencha tool.

rakumar
13 Aug 2019, 2:16 PM
Hello Paul,

Thank you for contacting Sencha Support!

I request you to provide some more details along with the package.json file to assist you in a better way.

Regards,
Kumar
Sencha Support.

pauldugas
28 Oct 2019, 9:41 AM
Apologies for resurrecting a dead thread but I started it so...

Running "sencha app build" in the project directory does build the combined desktop/phone webapp as expected however, running "npm run build" does not. Is there a way to build the combined app using npm only? I'm wondering because I'm trying to get a GitLab CI/CD script setup to build and deploy the webapp and would like to avoid having to install Cmd if possible.

I'm now working with the 7.0.0-CE release of ExtJS and Cmd. The generated package.json file has the "scripts" entry below. I suspect there's a way to run webpack twice to achieve what I'm after but am looking for some guidance.

"build": "npm run clean && cross-env webpack --env.profile=desktop --env.environment=production --env.treeshake=yes"

pauldugas
28 Oct 2019, 11:39 AM
Looks like removing the --env.profile=desktop option from the webpack command is the key. <fingers-crossed/>