build: add vue package

This commit is contained in:
Evan You
2018-10-23 11:58:37 -04:00
parent f57ca5e189
commit 0857d96438
10 changed files with 55 additions and 5 deletions

View File

@@ -9,6 +9,9 @@ const packagesDir = path.resolve(__dirname, '../packages')
const files = fs.readdirSync(packagesDir)
files.forEach(shortName => {
if (shortName === 'shared') {
return
}
if (!fs.statSync(path.join(packagesDir, shortName)).isDirectory()) {
return
}

View File

@@ -25,13 +25,14 @@ const { targets, fuzzyMatchTarget } = require('./utils')
const args = require('minimist')(process.argv.slice(2))
const target = args._[0]
const formats = args.formats || args.f
const buildAllMatching = args.all || args.a
;(async () => {
if (!target) {
await buildAll(targets)
checkAllSizes(targets)
} else {
await buildAll(fuzzyMatchTarget(target))
checkAllSizes(fuzzyMatchTarget(target))
await buildAll(fuzzyMatchTarget(target, buildAllMatching))
checkAllSizes(fuzzyMatchTarget(target, buildAllMatching))
}
})()

View File

@@ -11,11 +11,14 @@ const targets = (exports.targets = fs.readdirSync('packages').filter(f => {
return true
}))
exports.fuzzyMatchTarget = partialTarget => {
exports.fuzzyMatchTarget = (partialTarget, includeAllMatching) => {
const matched = []
for (const target of targets) {
if (target.match(partialTarget)) {
matched.push(target)
if (!includeAllMatching) {
return matched
}
}
}
if (matched.length) {