import { CapacitorConfig } from '@capacitor/cli'

let config: CapacitorConfig
const baseConfig: CapacitorConfig = {
    appId: 'com.hasiwlas.shorts',
    appName: '走馬短劇',
    webDir: 'dist',
    bundledWebRuntime: true,
    backgroundColor: '#1C1C1C',
    android: {
        buildOptions: {
            keystorePath: '../zouma.jks',
            keystorePassword: 'zouma123',
            keystoreAlias: 'zouma',
            keystoreAliasPassword: 'zouma123',
            releaseType: 'APK'
        },
        minWebViewVersion: 60
    },
    ios: {
        allowsLinkPreview: false
    },
    plugins: {
        SplashScreen: {
            launchShowDuration: 2000,
            androidScaleType: 'CENTER_CROP',
            splashFullScreen: true,
            splashImmersive: true
        },
        CodePush: {
            IOS_DEPLOY_KEY: 'eAdEIJJkMhuRwBKVpDXvbay6Ay0yEJAbzi0Ur',
            ANDROID_DEPLOY_KEY: 'ZrEsHcngd89oYtHZYQxLRUSMJ8trafzoNUVDN',
            SERVER_URL: 'https://codepush.appcenter.ms/'
        },
        CapacitorUpdater: {
            autoUpdate: false
        }
    },
    server: {
        errorPath: 'error.html',
        cleartext: true
    }
}
config = { ...baseConfig }
console.log('NODE_ENV: ', process.env.NODE_ENV)
switch (process.env.NODE_ENV) {
    case 'dev':
        config.server!.url = 'http://192.168.6.215:3000/h5/'
        break
    default:
        break
}

export default config
