-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathvite.config.js
More file actions
33 lines (32 loc) · 854 Bytes
/
vite.config.js
File metadata and controls
33 lines (32 loc) · 854 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
33
import { defineConfig } from 'vite';
// Build this CommonJS module as library for browsers via UMD and ESM outputs.
// The source exports a factory function via module.exports = createGraph.
// We'll expose it as `createGraph` global for UMD consumers, matching previous browserify -s output.
export default defineConfig({
build: {
lib: {
entry: 'index.js',
name: 'createGraph',
fileName: (format) => `ngraph.graph.${format}.js`,
formats: ['umd', 'es'],
},
rollupOptions: {
output: {
exports: 'default',
},
},
sourcemap: true,
outDir: 'dist',
emptyOutDir: false,
minify: 'esbuild',
},
test: {
include: ['test/**/*.js'],
environment: 'node',
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
reportsDirectory: 'coverage',
},
},
});