UNPKG

@antmove/wx-alipay

Version:

transform wechat miniprogram to alipay miniprogram tool.

24 lines (22 loc) 572 B
const path = require('path') const fs = require('fs-extra') module.exports = function(output, _npm = []) { let comName = '' let npmStr = '' if (Array.isArray(_npm) && _npm.length > 0) { _npm.forEach((name, i) => { if (i > 0) { comName += ',' } comName += `"${name}"` }) npmStr = `,"node_modules_es6_whitelist": [${comName}]` } const jsonStr = `{ "component2": true, "enableAppxNg": true ${npmStr} }` const miniPath = path.join(output, 'mini.project.json') fs.outputFile(miniPath, jsonStr) }