forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.js
38 lines (33 loc) · 1001 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
36
37
38
const { boolish } = require('getenv');
const process = require('process');
export async function build(task, opts) {
// Process JS/TS files with SWC
await task
.source('src/**/*.+(js|ts)', {
ignore: ['**/__tests__/**', '**/__mocks__/**'],
})
.swc('cli', { dev: opts.dev })
.target('build');
// Copy over JSON files
await task
.source('src/**/*.+(json)', {
ignore: ['**/__tests__/**', '**/__mocks__/**'],
})
.target('build');
}
export default async function (task) {
await task.clear('build');
await task.start('build', { dev: true });
}
export async function watch(task) {
const opts = { dev: true };
await task.clear('build');
await task.start('build', opts);
if (process.stdout.isTTY && !boolish('CI', false) && !boolish('EXPO_NONINTERACTIVE', false)) {
// Watch source folder
await task.watch('src/**/*.+(js|ts|json)', 'build', opts);
}
}
export async function release(task) {
await task.clear('build').start('build');
}