评论

uni-app vue-cli Jenkins通过CI构建到微信公众平台

uni-app vue-cli Jenkins通过CI构建到微信公众平台,

uni-app vue-cli CI流程搭建

目前可用服务构建发布小程序,例如Jenkins等,可方便开发者手动点上传.

默认目录

有疑问留言,回复不及时谅解~ci.js

const ci = require('miniprogram-ci')
const projectConfig = require('./project.config.json');
const updateVersion = require('./updateVersion.js')
const { version } = require('./package.json')
const project = new ci.Project({
  appid: projectConfig.appid,
  type: projectConfig.type,
  projectPath: projectConfig.projectPath,
  privateKeyPath: projectConfig.privateKeyPath,
  ignores: ['node_modules/**/*'],// 忽略的文件
})


async function upload() {
  await ci.upload({
    project,// 实例化的project
    version,// 更新的版本号
    setting: {// 上传的配置
      es7: true,
      minify: true,
      autoPrefixWXSS: true,
      minifyWXML: true,
      minifyWXSS: true,
      codeProtect: true,
    },
    onProgressUpdate: console.log,// 上传进度
  })
}
async function init() {
  await updateVersion()
  await upload()
}
init()

project.config.json

{
    "projectPath": "dist/build/mp-weixin/",//上传目录可修改
    "description": "项目配置文件",
    "setting": {//可修改,目前这个是build可以在微信开发者工具中拿到
        "urlCheck": false,
        "es6": true,
        "enhance": true,
        "postcss": true,
        "preloadBackgroundData": false,
        "minified": false,
        "newFeature": false,
        "coverView": true,
        "nodeModules": false,
        "autoAudits": false,
        "showShadowRootInWxmlPanel": true,
        "scopeDataCheck": false,
        "uglifyFileName": false,
        "checkInvalidKey": true,
        "checkSiteMap": true,
        "uploadWithSourceMap": true,
        "compileHotReLoad": false,
        "lazyloadPlaceholderEnable": false,
        "useMultiFrameRuntime": true,
        "useApiHook": true,
        "useApiHostProcess": true,
        "babelSetting": {
            "ignore": [],
            "disablePlugins": [],
            "outputPath": ""
        },
        "enableEngineNative": false,
        "useIsolateContext": true,
        "userConfirmedBundleSwitch": false,
        "packNpmManually": false,
        "packNpmRelationList": [],
        "minifyWXSS": true,
        "disableUseStrict": false,
        "showES6CompileOption": false,
        "useCompilerPlugins": false
    },
    "type": "miniprogram",
    "appid": appid,
    "privateKeyPath": "./ci-private.key",
    "condition": {
        "search": {
            "list": []
        },
        "conversation": {
            "list": []
        },
        "game": {
            "list": []
        },
        "miniprogram": {
            "list": []
        }
    }
}


最后一次编辑于  2022-06-06  
点赞 0
收藏
评论

1 个评论

  • Liu🐑
    Liu🐑
    2022-05-07

    nb

    2022-05-07
    赞同
    回复 1
    • 嘿嘿
      嘿嘿
      2022-05-09
      一起💪🏻
      2022-05-09
      回复
登录 后发表内容