parent
26171379d0
commit
dfdd158a75
|
@ -11,20 +11,9 @@ if (environment.production) {
|
|||
const bootstrap = () => platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.then(bootstrapModule => {
|
||||
// TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed
|
||||
// TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed?
|
||||
// if ('serviceWorker' in navigator && environment.production) {
|
||||
// navigator.serviceWorker.register('/ngsw-worker.js')
|
||||
// .catch(err => console.error('Cannot register service worker.', err))
|
||||
// }
|
||||
|
||||
if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') {
|
||||
navigator.serviceWorker.getRegistrations()
|
||||
.then(registrations => {
|
||||
for (const registration of registrations) {
|
||||
registration.unregister()
|
||||
}
|
||||
})
|
||||
if ('serviceWorker' in navigator && environment.production) {
|
||||
navigator.serviceWorker.register('/ngsw-worker.js')
|
||||
.catch(err => console.error('Cannot register service worker.', err))
|
||||
}
|
||||
|
||||
if (!environment.production) {
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
"resources": {
|
||||
"files": [
|
||||
"/index.html",
|
||||
"/client/assets/images/favicon.png",
|
||||
"/client/*.bundle.css",
|
||||
"/client/*.bundle.js",
|
||||
"/client/*.chunk.js",
|
||||
"/client/assets/images/icons/favicon.png",
|
||||
"/client/*.css",
|
||||
"/client/*.js",
|
||||
"/manifest.webmanifest"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -70,6 +70,8 @@ else
|
|||
npm run ng build -- --localize=false --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json $additionalParams
|
||||
fi
|
||||
|
||||
mv "./dist/$defaultLanguage/ngsw-worker.js" "./dist/"
|
||||
|
||||
cd ../ && npm run build:embed && cd client/
|
||||
|
||||
# Copy runtime locales
|
||||
|
|
Loading…
Reference in New Issue