-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
29 lines (28 loc) · 872 Bytes
/
vite.config.ts
File metadata and controls
29 lines (28 loc) · 872 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
import { dirname, resolve, isAbsolute } 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))
// https://vite.dev/config/
export default defineConfig({
plugins: [dts({ tsconfigPath: './tsconfig.app.json' })],
esbuild: {
charset: 'utf8',
},
build: {
sourcemap: true,
lib: {
entry: resolve(__dirname, 'src/index'),
name: 'data-source',
// the proper extensions will be added
fileName: 'data-source',
formats: ["es", "umd"]
},
rollupOptions: {
// external: ['mobx', 'ajv', 'axios'],
external: (id) => {
return !id.startsWith(".") && !isAbsolute(id);
},
},
},
})