We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新功能描述 在 manifest.json > mp-alipay 下增加一个 component2 属性配置,类型为 boolean 当有此字段时,编译输出的文件(dist/dev/mp-alipay 或 dist/build/mp-alipay) 下增加一个 mini.project.json 文件, 文件内容为:
component2
boolean
{ "component2": true /**(读取 manifest.json > mp-alipay > component2 中配置的值) */ }
支付宝小程序开发工具会读取此文件的值作为 component2 选项
现状及问题 生成输出后需要手动打开工具勾选 component2 选项
The text was updated successfully, but these errors were encountered:
您可以使用vue.config.js
manifest.json
vue.config.js
const path = require('path') const fs = require('fs') const Json5 = require('json5') /** * 自己实现支付宝配置 */ function MyPlugin(options) { this.options = options; } MyPlugin.prototype.apply = function(compiler) { // console.log('开始执行插件') compiler.plugin('compile', function() {}) compiler.plugin('compilation', function(compilation) { // console.log('编译器开始一个新的编译任务...-----') compilation.plugin('optimize', function() { // console.log('编译器开始优化文件...') }) }) compiler.plugin('done', function() { if (process.env.UNI_PLATFORM == 'mp-alipay') { const fscontent = Json5.parse(fs.readFileSync(path.join(__dirname, 'manifest.json'))) const filePath = path.join(__dirname + '/unpackage/', 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, '/', 'mini.project.json'); fs.writeFileSync(filePath, JSON.stringify(fscontent['mp-alipay'])) console.log('生成支付宝小程序项目配置文件成功') } }) }; module.exports = { configureWebpack: { plugins: [ new MyPlugin() ] } }
Sorry, something went wrong.
feat(mp-alipay): add mini.project.json #1164
355e0ef
2.5.0已支持
fxy060608
No branches or pull requests
新功能描述
在 manifest.json > mp-alipay 下增加一个
component2
属性配置,类型为boolean
当有此字段时,编译输出的文件(dist/dev/mp-alipay 或 dist/build/mp-alipay) 下增加一个 mini.project.json 文件, 文件内容为:
支付宝小程序开发工具会读取此文件的值作为 component2 选项
现状及问题
生成输出后需要手动打开工具勾选 component2 选项
The text was updated successfully, but these errors were encountered: