forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.js
35 lines (29 loc) · 931 Bytes
/
taskfile.js
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
26
27
28
29
30
31
32
33
34
35
const notifier = require('node-notifier')
export async function lib (task, opts) {
await task.source(opts.src || 'lib/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/lib')
notify('Compiled lib files')
}
export async function server (task, opts) {
await task.source(opts.src || 'server/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/server')
notify('Compiled server files')
}
export async function build (task) {
await task.parallel(['server', 'lib'])
}
export default async function (task) {
await task.clear('dist')
await task.start('build')
await task.watch('server/**/*.+(js|ts|tsx)', 'server')
await task.watch('lib/**/*.+(js|ts|tsx)', 'lib')
}
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
})
}