capacitor.config.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { CapacitorConfig } from '@capacitor/cli'
  2. import { ip, ipv6, mac } from 'address'
  3. let config: CapacitorConfig
  4. const baseConfig: CapacitorConfig = {
  5. appId: 'com.hasiwlas.shorts',
  6. appName: 'Kilat Drama',
  7. webDir: 'dist',
  8. bundledWebRuntime: true,
  9. backgroundColor: '#1C1C1C',
  10. android: {
  11. buildOptions: {
  12. keystorePath: '../zouma.jks',
  13. keystorePassword: 'zouma123',
  14. keystoreAlias: 'zouma',
  15. keystoreAliasPassword: 'zouma123',
  16. releaseType: 'APK'
  17. },
  18. minWebViewVersion: 60
  19. },
  20. ios: {
  21. allowsLinkPreview: false
  22. },
  23. plugins: {
  24. SplashScreen: {
  25. launchShowDuration: 2000,
  26. androidScaleType: 'CENTER_CROP',
  27. splashFullScreen: true,
  28. splashImmersive: true
  29. },
  30. CodePush: {
  31. IOS_DEPLOY_KEY: 'eAdEIJJkMhuRwBKVpDXvbay6Ay0yEJAbzi0Ur',
  32. ANDROID_DEPLOY_KEY: 'ZrEsHcngd89oYtHZYQxLRUSMJ8trafzoNUVDN',
  33. SERVER_URL: 'https://codepush.appcenter.ms/'
  34. },
  35. CapacitorUpdater: {
  36. autoUpdate: false
  37. }
  38. },
  39. server: {
  40. errorPath: 'error.html',
  41. cleartext: true
  42. }
  43. }
  44. config = { ...baseConfig }
  45. console.log('NODE_ENV: ', process.env.NODE_ENV)
  46. switch (process.env.NODE_ENV) {
  47. case 'dev':
  48. config.server!.url = `http://${ip()}:3000/h5/`
  49. break
  50. default:
  51. break
  52. }
  53. export default config