diff --git a/packages/vue-cli-plugin-uni/bin/uniapp-cli.js b/packages/vue-cli-plugin-uni/bin/uniapp-cli.js index 8a674386fa730e59eb233aa24aba2626dd48995a..4aefa0a10de225621991b72162d35959a5789f32 100755 --- a/packages/vue-cli-plugin-uni/bin/uniapp-cli.js +++ b/packages/vue-cli-plugin-uni/bin/uniapp-cli.js @@ -1,12 +1,12 @@ -#!/usr/bin/env node - -const yargsParser = require('yargs-parser') -const argv = yargsParser(process.argv.slice(2)) -const action = argv._[0] -if (action === 'custom') { - require('../lib/commands/custom')(argv) -} else if (action === 'invoke') { - require('../lib/commands/invoke')(argv) -} else { - process.exit(0) +#!/usr/bin/env node + +const yargsParser = require('yargs-parser') +const argv = yargsParser(process.argv.slice(2)) +const action = argv._[0] +if (action === 'custom') { + require('../lib/commands/custom')(argv) +} else if (action === 'invoke') { + require('../lib/commands/invoke')(argv) +} else { + process.exit(0) } diff --git a/packages/vue-cli-plugin-uni/lib/options.js b/packages/vue-cli-plugin-uni/lib/options.js index 05d0770ee592850939e7f7344aca538d68a23106..7424e1a8bd0a46bf3ed31047cb848f5665a44de5 100644 --- a/packages/vue-cli-plugin-uni/lib/options.js +++ b/packages/vue-cli-plugin-uni/lib/options.js @@ -27,8 +27,10 @@ module.exports = function initOptions (options) { options.transpileDependencies.push(genTranspileDepRegex(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules'))) options.transpileDependencies.push('@dcloudio/uni-' + process.env.UNI_PLATFORM) options.transpileDependencies.push('@dcloudio/uni-stat') - // mp runtime - options.transpileDependencies.push('@dcloudio/uni-mp-weixin/dist/mp.js') + + if (process.env.UNI_PLATFORM !== 'mp-weixin') { // mp runtime + options.transpileDependencies.push('@dcloudio/uni-mp-weixin') + } if (process.env.UNI_PLATFORM === 'h5') { // h5 dev 用到了这两个,需要 babel options.transpileDependencies.push('ansi-regex')