capacitor.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { CapacitorConfig } from '@capacitor/cli'
  2. import * as fs from 'fs'
  3. const version = fs.readFileSync('static/package.json', 'utf8').match(/"version": "(.*?)"/)?.at(1) ?? '0.0.0'
  4. const config: CapacitorConfig = {
  5. appId: 'com.logseq.app',
  6. appName: 'Logseq',
  7. webDir: 'static/capacitor',
  8. loggingBehavior: 'debug',
  9. server: {
  10. url: "https://192.168.10.208:3002",
  11. cleartext: true
  12. },
  13. plugins: {
  14. StatusBar: {
  15. overlaysWebView: true,
  16. style: 'Light',
  17. backgroundColor: '#ffffffff',
  18. },
  19. SplashScreen: {
  20. launchShowDuration: 500,
  21. launchAutoHide: false,
  22. androidScaleType: 'CENTER_CROP',
  23. splashImmersive: false,
  24. backgroundColor: '#002b36'
  25. },
  26. Keyboard: {
  27. resize: 'none'
  28. }
  29. },
  30. android: {
  31. appendUserAgent: `Logseq/${version} (Android)`
  32. },
  33. ios: {
  34. scheme: 'Logseq',
  35. appendUserAgent: `Logseq/${version} (iOS)`
  36. }
  37. }
  38. if (process.env.LOGSEQ_APP_SERVER_URL) {
  39. Object.assign(config, {
  40. server: {
  41. url: process.env.LOGSEQ_APP_SERVER_URL,
  42. cleartext: true
  43. }
  44. })
  45. }
  46. export = config;