Skip to content

Instantly share code, notes, and snippets.

@vita2333
Created June 19, 2020 04:41
Show Gist options
  • Save vita2333/8bf3b5199d265f8ad90c22bbf4dc3e25 to your computer and use it in GitHub Desktop.
Save vita2333/8bf3b5199d265f8ad90c22bbf4dc3e25 to your computer and use it in GitHub Desktop.
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