-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
38 lines (36 loc) · 932 Bytes
/
rollup.config.ts
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
import typescript from '@rollup/plugin-typescript';
import scriptableBundle from "@jag-k/rollup-plugin-scriptable";
import * as config from "./config.json";
import copy from 'rollup-plugin-copy';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import {homedir} from "os";
import {source} from "./package.json"
const DIST_DIR = 'dist';
export default {
input: source,
output: [
{
file: `${DIST_DIR}/${config.name}.js`,
format: 'es',
plugins: [scriptableBundle(config)]
},
],
plugins: [
nodeResolve(),
typescript(),
...(
process.env.COPY_TO_ICLOUD === 'true' ? [
copy({
verbose: true,
hook: 'writeBundle',
targets: [
{
src: `${DIST_DIR}/*.js`,
dest: `${homedir()}/Library/Mobile Documents/iCloud~dk~simonbs~Scriptable/Documents`
},
]
})
] : []
)
]
};