-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.cjs
executable file
·66 lines (56 loc) · 1.26 KB
/
BUILD.cjs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env -S npx bajel serve
// const COMPILEJS = 'java -jar tools/closure/closure-compiler-v20190929.jar -O ADVANCED --externs js/externs.js'
const COMPILED = [
'sw.js',
'_includes/every.js',
'_includes/home.js',
'_includes/post.js',
'_includes/post_blocking.js'
]
// const compile = `${COMPILEJS} --js $< --js_output_file $@`
const compile = 'cp $< $@'
module.exports = {
serve: {
deps: ['compile'],
exec: 'jekyll serve --port 8000 --strict_front_matter --watch --drafts'
},
compile: {
deps: ['extra', ...COMPILED]
},
'sw.js': {
deps: ['js/sw.js'],
exec: compile
},
'_includes/%.js': {
deps: ['js/%.js', 'js/externs.js'],
exec: compile
},
prodbuild: {
deps: ['compile'],
exec: `
JEKYLL_ENV=production jekyll build --strict_front_matter --config _config.yml,_secret.yml
minify --list --verbose --recursive --output _site/ _site
`
},
deploy: {
deps: ['prodbuild'],
exec: 'firebase deploy'
},
extra: {
exec: 'cd extra/covidgrowth && npx bajel'
},
refetch: {
exec: `
cd extra/covidgrowth
npx bajel clean
npx bajel
`
},
clean: {
exec: `
jekyll clean
rm -f ${COMPILED.join(' ')}
(cd extra/covidgrowth && npx bajel clean)
`
}
}