mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 21:56:18 -08:00
build(tauri): resolve build issues
This commit is contained in:
1 parent
34ba4aafca
commit
942b79c303
4 files changed
+89
-6
No files matched your search
+9
-1
@@ -1,6 +1,5 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { AppConfig } from './environments/environment';
|
||||
|
||||
@@ -8,8 +7,17 @@ if (AppConfig.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
// Detect if running in Tauri
|
||||
const isTauri = window && (window as any).__TAURI__;
|
||||
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule, {
|
||||
preserveWhitespaces: false,
|
||||
})
|
||||
.then(() => {
|
||||
// Only register service worker for web builds
|
||||
if (!isTauri && 'serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/ngsw-worker.js');
|
||||
}
|
||||
})
|
||||
.catch((err) => console.error(err));
|
||||
Reference in new issue
Block a user