I want to publish my application as PWA, so what I did
paste this script in index.html
<!--script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('service-worker.js') .then(() => console.log('service worker installed')) .catch(err => console.log('Error', err)); } </script-->
then install
npm run ionic:build --prod
it looks like he is deploying it, but my questions are:
why, when I change something in the application and start the ionic service, nothing changes, and it changes only in the index.html of the WWW folder? why? (because now it's PWA ??)
when I open the www folder and run open index.html when I click the button to open a warning dialog about opening. why?
Run
ionic cordova platform add browser
ionic build browser --prod --release
[project_folder]/platforms/browser/www http-.
[project_folder]/platforms/browser/www
PWA. npm run build --prod /www.
npm run build --prod
/www
PWA , "on" "off". , , , , "", , , .. , , PWA, "" ( , , ). , HTTPS .
index.html, cordova.js( 404, /www).
-
ionic cordova build browser
IONIC-PROJECT/platform/browser/www -.
Ionic pwa https://github.com/enaizi/pwa-sidemenu. Google Workbox.