-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.js
43 lines (41 loc) · 923 Bytes
/
vite.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
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue2'
import copy from 'rollup-plugin-copy'
const repoDir = dirname(fileURLToPath(import.meta.url))
export default defineConfig({
build: {
commonjsOptions: { include: [] },
lib: {
entry: resolve(repoDir, 'src/index.js'),
formats: ['es', 'cjs']
},
minify: false,
rollupOptions: {
external: ['vue'],
output: {
entryFileNames: '[format]/vue-postgrest.js',
exports: 'named'
}
},
sourcemap: true
},
plugins: [
vue(),
copy({
targets: [
{ src: 'package.json.cjs', dest: 'dist/cjs', rename: 'package.json' }
],
hook: 'writeBundle'
})
],
resolve: {
alias: [
{
find: /^@\//,
replacement: resolve(repoDir, 'src') + '/'
}
]
}
})