capacitor.config.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { CapacitorConfig } from '@capacitor/cli'
  2. import 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. bundledWebRuntime: false,
  8. webDir: 'public',
  9. loggingBehavior: 'debug',
  10. plugins: {
  11. SplashScreen: {
  12. launchShowDuration: 500,
  13. launchAutoHide: false,
  14. androidScaleType: 'CENTER_CROP',
  15. splashImmersive: false,
  16. backgroundColor: '#002b36'
  17. },
  18. Keyboard: {
  19. resize: 'none'
  20. }
  21. },
  22. android: {
  23. appendUserAgent: `Logseq/${version} (Android)`
  24. },
  25. ios: {
  26. scheme: 'Logseq',
  27. appendUserAgent: `Logseq/${version} (iOS)`
  28. },
  29. cordova: {
  30. staticPlugins: [
  31. '@logseq/capacitor-file-sync', // AgeEncryption requires static link
  32. ]
  33. }
  34. }
  35. if (process.env.LOGSEQ_APP_SERVER_URL) {
  36. Object.assign(config, {
  37. server: {
  38. url: process.env.LOGSEQ_APP_SERVER_URL,
  39. cleartext: true
  40. }
  41. })
  42. }
  43. export = config;