let version = __wxConfig.envVersion;

console.log('配置文件加载')
// #ifdef MP-WEIXIN
console.log('微信小程序验证')
console.log(__wxConfig.envVersion)
if (version === 'develop') {
    //开发环境
    ENV_CONFIG = require('.env.dev.js');
    ENV_CONFIG.isCanvas2d = false
}else if (__wxConfig.envVersion === 'release') {
    //生产环境
    ENV_CONFIG = require('.env.prod.js');
    ENV_CONFIG.isCanvas2d = true
}  else {
    //体验环境
    ENV_CONFIG = require('.env.prod.js');
    ENV_CONFIG.isCanvas2d = true
}
//#endif
// #ifndef MP-WEIXIN
console.log('其它环境验证')
if (version === 'develop') {
    //开发环境
    // ENV_CONFIG = require('.env.dev.js');
    ENV_CONFIG = require('.env.trial.js');
    ENV_CONFIG.isCanvas2d = false
    // ENV_CONFIG = require('.env.prod.js');
}else if(version === 'trial'){
    //体验环境
    ENV_CONFIG = require('.env.trial.js');
    ENV_CONFIG.isCanvas2d = true
} else{

    //生产环境
    ENV_CONFIG = require('.env.prod.js');
    ENV_CONFIG.isCanvas2d = true
}
//#endif
// #ifdef MP-WEIXIN
//给环境变量process.uniEnv赋值
if (ENV_CONFIG !== null) {
    process.uniEnv = {};
    for (let key in ENV_CONFIG) {
        process.uniEnv[key] = ENV_CONFIG[key];
    }
    // #ifdef H5
    if (nodeEnv !== 'development') {
        process.uniEnv.baseUrl = window.location.hostname;
    }
    //#endif
}
//#endif
