capacitor.config.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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/mobile',
  8. loggingBehavior: 'debug',
  9. server: {
  10. androidScheme: 'http',
  11. },
  12. plugins: {
  13. StatusBar: {
  14. overlaysWebView: true,
  15. style: 'Light',
  16. backgroundColor: '#ffffffff',
  17. },
  18. SplashScreen: {
  19. launchShowDuration: 500,
  20. launchAutoHide: false,
  21. androidScaleType: 'CENTER_CROP',
  22. splashImmersive: false,
  23. backgroundColor: '#002b36'
  24. },
  25. Keyboard: {
  26. resize: 'none'
  27. },
  28. SafeArea: {
  29. enabled: true,
  30. customColorsForSystemBars: true,
  31. statusBarColor: '#000000',
  32. statusBarContent: 'light',
  33. navigationBarColor: '#000000',
  34. navigationBarContent: 'light',
  35. offset: 0
  36. }
  37. },
  38. android: {
  39. appendUserAgent: `Logseq/${version} (Android)`
  40. },
  41. ios: {
  42. scheme: 'Logseq',
  43. appendUserAgent: `Logseq/${version} (iOS)`
  44. }
  45. }
  46. if (process.env.LOGSEQ_APP_SERVER_URL) {
  47. Object.assign(config, {
  48. server: {
  49. url: process.env.LOGSEQ_APP_SERVER_URL,
  50. cleartext: true
  51. }
  52. })
  53. }
  54. export = config;