capacitor.config.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. },
  29. android: {
  30. appendUserAgent: `Logseq/${version} (Android)`
  31. },
  32. ios: {
  33. scheme: 'Logseq',
  34. appendUserAgent: `Logseq/${version} (iOS)`
  35. }
  36. }
  37. if (process.env.LOGSEQ_APP_SERVER_URL) {
  38. Object.assign(config, {
  39. server: {
  40. url: process.env.LOGSEQ_APP_SERVER_URL,
  41. cleartext: true
  42. }
  43. })
  44. }
  45. export = config;