文章描述不清 有疑问可以私信 Alison-Bird
参考:https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html
参考:https://www.npmjs.com/package/miniprogram-ci
npm install miniprogram-ci -S
上传文件
xx.js文章来源:https://www.toymoban.com/news/detail-733563.html
const isNodeJs = typeof process !== 'undefined' && process.release != null && process.release.name === 'node';
let env = "";
if (isNodeJs) {
//文件处理
const fs = require("fs")
env = process && process.argv.slice(2)[0].split("=")[1];
fs.writeFileSync('./utils/env.js', "export let env='" + env + "'");
let version = '1.3.6';
const ci = require('miniprogram-ci');
(async () => {
const project = new ci.Project({
appid: 'wxdb4f1710594a061a',
type: 'miniProgram',
projectPath: './',
privateKeyPath: './private.wxdb4f1710594a061a.key',
ignores: ['node_modules/**/*', 'build/*', 'package.json', 'package-lock.json', 'gulpfile.js', '*.key'],
})
const uploadResult = await ci.upload({
project,
version,
desc: '小程序测试',
setting: {
minify: true,
es6: true,
es7: true,
minifyJS: true,
minifyWXML: true,
minifyWXSS: true,
autoPrefixWXSS: true
},
onProgressUpdate: console.log,
})
console.log(uploadResult, '===>')
// const previewResult = await ci.preview({
// project,
// desc: '1.1.4',
// setting:{
// es6: true,
// },
// robot:2,
// qrcodeFormat: 'image',
// qrcodeOutputDest: './test.jpg',
// onProgressUpdate: console.log,
// });
// console.log(previewResult);
})()
}
文章来源地址https://www.toymoban.com/news/detail-733563.html
到了这里,关于微信小程序自动化发布的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!