capacitor.config.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { CapacitorConfig } from '@capacitor/cli'
  2. import { KeyboardResize } from '@capacitor/keyboard'
  3. import * as fs from 'fs'
  4. const version = fs.readFileSync('static/package.json', 'utf8').match(/"version": "(.*?)"/)?.at(1) ?? '0.0.0'
  5. const config: CapacitorConfig = {
  6. appId: 'com.logseq.app',
  7. appName: 'Logseq',
  8. webDir: 'static/mobile',
  9. loggingBehavior: 'debug',
  10. server: {
  11. androidScheme: 'http',
  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: KeyboardResize.None,
  28. resizeOnFullScreen: true,
  29. },
  30. SafeArea: {
  31. enabled: true,
  32. customColorsForSystemBars: true,
  33. statusBarColor: '#000000',
  34. statusBarContent: 'light',
  35. navigationBarColor: '#000000',
  36. navigationBarContent: 'light',
  37. offset: 0
  38. }
  39. },
  40. android: {
  41. appendUserAgent: `Logseq/${version} (Android)`,
  42. },
  43. ios: {
  44. scheme: 'Logseq',
  45. appendUserAgent: `Logseq/${version} (iOS)`,
  46. }
  47. }
  48. if (process.env.LOGSEQ_APP_SERVER_URL) {
  49. Object.assign(config, {
  50. server: {
  51. url: process.env.LOGSEQ_APP_SERVER_URL,
  52. cleartext: true
  53. }
  54. })
  55. }
  56. export = config;