forked from BioNGFF/ome-zarr.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
32 lines (29 loc) · 878 Bytes
/
Copy pathvite.config.js
File metadata and controls
32 lines (29 loc) · 878 Bytes
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
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
const __dirname = dirname(fileURLToPath(import.meta.url))
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'ome-zarr',
// the proper extensions will be added
fileName: 'ome-zarr',
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['zarrita'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
zarrita: 'zarr',
},
},
},
},
// generate single ome-zarr.d.ts file on build
plugins: [dts({ tsconfigPath: './tsconfig.json', rollupTypes: true })]
})