forked from hoythan/Scriptable-Audi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
35 lines (31 loc) · 955 Bytes
/
rollup.config.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
import eslint from '@rollup/plugin-eslint'
import replace from '@rollup/plugin-replace'
import banner2 from 'rollup-plugin-banner2'
const isDebug = process.env.DEBUG
const isTheme = process.env.THEME
const suffix = isDebug ? 'Debug' : 'Joiner'
const banner = `// These must be at the very top of the file. Do not edit.
// icon-color: ${isDebug ? 'deep-gray' : isTheme ? 'purple' : 'cyan'}; icon-glyph: ${isTheme ? 'star' : 'car'};
// Variables used by Scriptable.
//
// author: 淮城一只猫<\[email protected]>
`
export default {
input: isTheme ? `src/themes/${process.env.FILE}.js` : `src/${process.env.FILE}.js`,
output: {
file: isTheme ? `dist/${process.env.FILE}.js` : `dist/${process.env.FILE}-${suffix}.js`,
format: 'es'
},
plugins: [
replace({
preventAssignment: true,
values: {
'Testing': isDebug ? 'Testing' : 'Running'
}
}),
eslint({
fix: true
}),
banner2(() => banner)
]
}