UNPKG

519 BJavaScriptView Raw
1#!/usr/bin/env node
2const build = require('../src/build')
3const dev = require('../src/dev')
4const task = process.argv.slice(2)[0] || 'build'
5
6;(async () => {
7 switch(task) {
8 case 'dev':
9 await dev()
10 break
11 case 'build':
12 try {
13 await build()
14 process.exit(0)
15 }
16 catch(error) {
17 console.error('Build failed :(', error)
18 process.exit(1)
19 }
20 break
21 default:
22 throw new Error('Unknown option. Only `dev` and `build` are supported.')
23 }
24})()