mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -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
+3
-3
@@ -59,7 +59,7 @@
|
||||
},
|
||||
"web": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"outputHashing": "none",
|
||||
"sourceMap": false,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
@@ -74,8 +74,8 @@
|
||||
]
|
||||
},
|
||||
"production": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"optimization": false,
|
||||
"outputHashing": "none",
|
||||
"sourceMap": false,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>localhost</key>
|
||||
<dict>
|
||||
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
||||
<true/>
|
||||
<key>NSIncludesSubdomains</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -22,7 +22,54 @@
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src 'self' 'unsafe-eval' 'unsafe-inline'; media-src *"
|
||||
"csp": {
|
||||
"default-src": [
|
||||
"'self'",
|
||||
"data:",
|
||||
"tauri:",
|
||||
"asset:",
|
||||
"blob:",
|
||||
"https:",
|
||||
"http:",
|
||||
"'unsafe-eval'",
|
||||
"'unsafe-inline'"
|
||||
],
|
||||
"img-src": [
|
||||
"'self'",
|
||||
"data:",
|
||||
"asset:",
|
||||
"https:",
|
||||
"http:",
|
||||
"blob:"
|
||||
],
|
||||
"media-src": ["'self'", "https:", "http:", "blob:", "data:"],
|
||||
"script-src": [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
"'unsafe-eval'",
|
||||
"tauri:",
|
||||
"asset:"
|
||||
],
|
||||
"style-src": [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
"https:",
|
||||
"http:",
|
||||
"https://fonts.googleapis.com"
|
||||
],
|
||||
"font-src": ["'self'", "https://fonts.gstatic.com", "data:"],
|
||||
"connect-src": [
|
||||
"'self'",
|
||||
"https:",
|
||||
"http:",
|
||||
"ws:",
|
||||
"wss:",
|
||||
"data:",
|
||||
"tauri:"
|
||||
],
|
||||
"frame-src": ["'self'", "https:", "http:", "blob:", "data:"],
|
||||
"worker-src": ["'self'", "blob:", "data:"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
@@ -34,6 +81,13 @@
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
],
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "*",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
}
|
||||
}
|
||||
}
|
||||
+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