Exporting Ionic 4 Pwa in a single folder

Hi, back in the day ( Ionic v3 ) you could export your PWA with a single “build” folder + index.html + manifest.json + service-worker.js.

That was a much cleaner way to export the PWA, now the ionic build is building the app with a load of js files all at the same level of index.html… I’m looking for a way to get back to clean way. Is it possibile ?

I know we can workaround it with firebase(deploy), then redirect the website with .htaccess but I’d like to know of there is a faster way like it used to be few years ago…

Thanks in advance,
Niccolò

Hi
not sure if this helps, but I am deploying my angular4-pwa enabled app via firebase deploy and do not need to worry (nor care) about the files.

The firebase setup in firebase.json rewrites all URLs to index.html

"rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],

I think, strictly spoken, one should not care too much about anything that is generated by the CLI.

The load of JS is because of lazy loading.

And if you use angular then the PWA toolkit handles all for you.

So I wonder what problem you really trying to solve

Hi, thanks for your reply!

FIREBASE WAY:
Once you deployed your app btw the domain something like : www.YourAppName-code.firebaseapp.com right?
If not, how did you change the domain to your custom domain? (after you bought is from a registrar of course)

FTP WAY:
An alternative to firebase deploy is using a ftp manager program like FileZilla and upload the www contents to your domain. This create a lot of js files and it makes the environment a little bit dirty.
I’d like to upload the www folder like it used to be in Ionic 3 in order to have all the necessary file INSIDE the www folder instead of having everything spread out.

I’d like to get this:

www.mydomain.com
|-------|MyFolder1 (not related to PWA)
|-------|MyPWA
-----------|-> index.html
-----------|-> worker-basic.min.js
-----------|-> safety-worker.js
-----------|-> all .js stuff
-----------|-> …
|-------|MyFolder2(Not related to PWA)
|-------|MyFolder3(Not related to PWA)

and NOT this:

www.mydomain.com
|-------|MyFolder1 (not related to PWA)
|------- index.html
|------- worker-basic.min.js
|------- safety-worker.js
|------- all .js stuff

|-------|MyFolder2(Not related to PWA)
|-------|MyFolder3(Not related to PWA)

Thanks again,
N

Hi

I use the firebase cli to deploy and obviously there are ways to connect your own domain. https://firebase.google.com/docs/hosting/custom-domain

And with FileZilla you can upload a folder and again, u shouldn’t be bothered with the build results. A waste of time figuring out how to correct and moreover, if you do it incorrectly, you will get hard to find bugs.

But then again up to you