zoukankan      html  css  js  c++  java
  • cordova插件根据 不同环境设置不同key

    /* eslint-disable */
    
    /**
     * 根据环境变量初始化一些第三方库需要的key
     */
    const { m: target } = require('yargs').argv
    const { OPENINSTALL_APPKEY } = require('../configs').appConfigs
    const { readFileSync, writeFileSync, removeSync } = require('fs-extra')
    const installMissing = require('@quasar/app/lib/mode/install-missing')
    
    // 配置openInstall appKey和scheme
    const initOpenInstall = function initOpenInstall() {
      const pkg = JSON.parse(readFileSync('./src-cordova/package.json', 'utf-8'))
    
      openInstall = pkg.cordova.plugins['cordova-plugin-openinstall']
      openInstall.OPENINSTALL_APPKEY = OPENINSTALL_APPKEY
      openInstall.OPENINSTALL_SCHEME = OPENINSTALL_APPKEY
      writeFileSync('./src-cordova/package.json', JSON.stringify(pkg, null, 2), 'utf-8')
    
      removeSync('./src-cordova/plugins')
      removeSync('./src-cordova/platforms')
    
      installMissing('cordova', target)
    }
    
    module.exports = function initKeys() {
      if (target) {
        initOpenInstall()
      }
    }
  • 相关阅读:
    移动端 细节点
    基于新版 node 的 vue 脚手架搭建
    全屏展示
    Vue 小实例
    移动端 模拟键盘 盖住表单
    decodeURI decodeURIComponent
    简单时钟
    全选 反选 传统写法
    星级点评 面向过程的传统写法
    JQ字符串截取
  • 原文地址:https://www.cnblogs.com/xtxtx/p/14548727.html
Copyright © 2011-2022 走看看