capacitor.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. server: {
  11. // https://capacitorjs.com/docs/updating/5-0#update-androidscheme
  12. androidScheme: 'http',
  13. },
  14. plugins: {
  15. SplashScreen: {
  16. launchShowDuration: 500,
  17. launchAutoHide: false,
  18. androidScaleType: 'CENTER_CROP',
  19. splashImmersive: false,
  20. backgroundColor: '#002b36'
  21. },
  22. Keyboard: {
  23. resize: 'none'
  24. }
  25. },
  26. android: {
  27. appendUserAgent: `Logseq/${version} (Android)`
  28. },
  29. ios: {
  30. scheme: 'Logseq',
  31. appendUserAgent: `Logseq/${version} (iOS)`
  32. },
  33. cordova: {
  34. staticPlugins: [
  35. '@logseq/capacitor-file-sync', // AgeEncryption requires static link
  36. ]
  37. }
  38. }
  39. if (process.env.LOGSEQ_APP_SERVER_URL) {
  40. Object.assign(config, {
  41. server: {
  42. url: process.env.LOGSEQ_APP_SERVER_URL,
  43. cleartext: true
  44. }
  45. })
  46. }
  47. export = config;