-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
49 lines (44 loc) · 978 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { createRollupConfig, createTypeConfig } from 'rollup-library-template';
const baseConfig = {
filesize: true,
minify: true,
extra: {
treeshake: true,
},
};
const external = ['@iiif/helpers/vault'];
const bundled = ['@iiif/parser', '@iiif/helpers/vault/actions'];
const nodeExternal = [];
// Roll up configs
export default [
createTypeConfig({
source: './.build/types/index.d.ts',
}),
// UMD bundle will have everything.
createRollupConfig({
...baseConfig,
inlineDynamicImports: true,
input: './src/index.ts',
output: {
name: 'IIIFBuilder',
file: `dist/index.umd.js`,
format: 'umd',
},
nodeResolve: {
browser: true,
},
}),
// import {} from '@iiif/vault';
createRollupConfig({
...baseConfig,
input: './src/index.ts',
distPreset: 'esm',
external,
}),
createRollupConfig({
...baseConfig,
input: './src/index.ts',
distPreset: 'cjs',
external,
}),
];