Created
June 19, 2020 04:41
-
-
Save vita2333/8bf3b5199d265f8ad90c22bbf4dc3e25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { run } = require('runjs') | |
const glob = require('glob') | |
const list = | |
{ | |
index: { | |
input: 'packages/index.ts', | |
output: 'index', | |
}, | |
} | |
glob.sync('./packages/*/index.ts').forEach(path => { | |
const chunk = path.split('packages/')[1].split('/index')[0] | |
list[chunk] = { | |
input: `packages/${ chunk }/index.ts`, | |
output: chunk, | |
} | |
}) | |
Object.keys(list).forEach(i => { | |
const { input, output } = list[i] | |
run( | |
`vue-cli-service build --target lib --no-clean --name ${ output } --dest lib ${ input }`, | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment