summaryrefslogtreecommitdiff
path: root/support/list-aliases.js
blob: d1eeed5ad5ab85395b3702e91ae68bfffcae456f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
const path = require('path')
const yargs = require('yargs')
const aliases = require('./aliases')

const argv = yargs
    .option('sources', {
        type: 'boolean',
        default: false
    })
    .argv

const prefix = argv._[0] || 'build-es/'

const targets = Object.keys(aliases).map(argv.sources ? expandSource : expandAlias)
process.stdout.write(targets.join(' '))


function expandAlias (alias) {
    return path.join(prefix, `${alias}.js`)
}

function expandSource (alias) {
    return path.join(prefix, `${aliases[alias]}.js`)
}