-
Notifications
You must be signed in to change notification settings - Fork 23
/
rollup.config.ts
58 lines (56 loc) · 1.44 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import visualizer from 'rollup-plugin-visualizer';
const commonPlugins = () => [typescript({ useTsconfigDeclarationDir: true }), commonjs(), resolve()];
export default [
{
input: 'src/zarr.ts',
output: [{
dir: 'dist/',
format: 'es',
entryFileNames: '[name].mjs',
chunkFileNames: '[name].mjs',
manualChunks: { core: ['src/zarr-core.ts'] },
minifyInternalExports: false,
sourcemap: true,
},
{
dir: 'dist/',
format: 'es',
entryFileNames: '[name].min.mjs',
chunkFileNames: '[name].min.mjs',
manualChunks: { core: ['src/zarr-core.ts'] },
minifyInternalExports: false,
sourcemap: true,
plugins: [terser()]
},
],
watch: {
include: 'src/**',
},
plugins: [
...commonPlugins(),
visualizer({ filename: "stats.html" }),
visualizer({ filename: "stats.min.html", sourcemap: true })
],
},
{
input: 'src/zarr.ts',
output: [
{ file: 'dist/zarr.cjs', format: 'cjs', sourcemap: true },
{
file: 'dist/zarr.umd.js',
name: 'zarr',
format: 'umd',
sourcemap: true,
esModule: false,
plugins: [terser()],
},
],
plugins: [
...commonPlugins()
],
},
];