收藏
回答

怎样模拟微信工具的上传,将本地开发好的小程序上传微信服务器?

从文档中 https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html

需要运行脚本 npm install miniprogram-ci --save
脚本运行完成后,在本地生成了C:\Users\Administrator\node_modules
const ci = require('miniprogram-ci')//这块具体怎么引进来
;(async () => {
  const project = new ci.Project({
    appid: 'wxsomeappid',
    type: 'miniProgram',
    projectPath: 'the/project/path',//项目在d盘下,这块路径怎么写
    privateKeyPath: 'the/path/to/privatekey',//私钥在本地d盘,这块路径怎么写
    ignores: ['node_modules/**/*'],
  })
  const uploadResult = await ci.upload({
    project,
    version: '1.1.1',
    desc: 'hello',
    setting: {
      es6: true,
    },
    onProgressUpdate: console.log,
  })
  console.log(uploadResult)
})()


回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-06-11

    你得先学会nodejs

    2020-06-11
    有用
    回复 8
    • 玉龙
      玉龙
      2020-06-11
      有例子吗,给个demo
      2020-06-11
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-06-11回复玉龙
      2020-06-11
      回复
    • 玉龙
      玉龙
      2020-06-11回复Mr.Zhao
      我是在小程序页面写了个发布按钮,点击触发上传,这样有问题吗
      2020-06-11
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-06-11回复玉龙
      不能这么玩吗
      2020-06-11
      回复
    • 玉龙
      玉龙
      2020-06-11
      现在在这句就报错 const ci = require('miniprogram-ci')
      2020-06-11
      回复
    查看更多(3)
登录 后发表内容
问题标签