2018-10-01 22:55:31 +00:00
|
|
|
const notifier = require('node-notifier')
|
|
|
|
|
|
|
|
export async function lib (task, opts) {
|
2018-12-13 00:00:46 +00:00
|
|
|
await task.source(opts.src || 'lib/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/lib')
|
2018-10-01 22:55:31 +00:00
|
|
|
notify('Compiled lib files')
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function server (task, opts) {
|
2018-12-13 00:00:46 +00:00
|
|
|
await task.source(opts.src || 'server/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/server')
|
2018-10-01 22:55:31 +00:00
|
|
|
notify('Compiled server files')
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function build (task) {
|
2018-11-28 14:03:02 +00:00
|
|
|
await task.parallel(['server', 'lib'])
|
2018-10-01 22:55:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default async function (task) {
|
2018-11-30 12:10:30 +00:00
|
|
|
await task.clear('dist')
|
2018-10-01 22:55:31 +00:00
|
|
|
await task.start('build')
|
2018-12-13 00:00:46 +00:00
|
|
|
await task.watch('server/**/*.+(js|ts|tsx)', 'server')
|
|
|
|
await task.watch('lib/**/*.+(js|ts|tsx)', 'lib')
|
2018-10-01 22:55:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function release (task) {
|
|
|
|
await task.clear('dist').start('build')
|
|
|
|
}
|
|
|
|
|
|
|
|
// notification helper
|
|
|
|
function notify (msg) {
|
|
|
|
return notifier.notify({
|
|
|
|
title: '▲ Next',
|
|
|
|
message: msg,
|
|
|
|
icon: false
|
|
|
|
})
|
|
|
|
}
|