Open banli17 opened 4 months ago
const args = require('minimist')(process.argv.slice(2)) const targets = args._ const formats = args.formats || args.f const devOnly = args.devOnly || args.d const prodOnly = !devOnly && (args.prodOnly || args.p) const sourceMap = args.sourcemap || args.s await execa( 'rollup', [ '-c', '--environment', [ `COMMIT:${commit}`, `NODE_ENV:${env}`, `TARGET:${target}`, formats ? `FORMATS:${formats}` : ``, buildTypes ? `TYPES:true` : ``, prodOnly ? `PROD_ONLY:true` : ``, sourceMap ? `SOURCE_MAP:true` : `` ] .filter(Boolean) .join(',') ], { stdio: 'inherit' } )
阅读源码准则:
即跟着主逻辑,没有涉及到的分支情况忽略。