capacitor.config.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { CapacitorConfig } from '@capacitor/cli'
  2. let config: CapacitorConfig
  3. const baseConfig: CapacitorConfig = {
  4. appId: 'com.hasiwl.shorts',
  5. appName: 'xx短剧',
  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. },
  27. CodePush: {
  28. IOS_DEPLOY_KEY: 'eAdEIJJkMhuRwBKVpDXvbay6Ay0yEJAbzi0Ur',
  29. ANDROID_DEPLOY_KEY: 'ZrEsHcngd89oYtHZYQxLRUSMJ8trafzoNUVDN',
  30. SERVER_URL: 'https://codepush.appcenter.ms/'
  31. }
  32. },
  33. server: {
  34. errorPath: 'error.html',
  35. cleartext: true
  36. },
  37. }
  38. config = { ...baseConfig }
  39. console.log('NODE_ENV: ', process.env.NODE_ENV)
  40. switch (process.env.NODE_ENV) {
  41. case 'dev':
  42. config.server!.url = 'http://192.168.6.215:3000/h5/'
  43. break
  44. default:
  45. config.android!.flavor = 'prod'
  46. break
  47. }
  48. export default config