capacitor.config.ts 1.4 KB

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