-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathvite.api.config.js
More file actions
37 lines (33 loc) · 838 Bytes
/
Copy pathvite.api.config.js
File metadata and controls
37 lines (33 loc) · 838 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
34
35
36
37
import { URL, fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
import EsJS from '@es-js/vite-plugin-esjs'
import devServer from '@hono/vite-dev-server'
export default defineConfig({
plugins: [
// https://github.com/es-js/esjs
EsJS(),
devServer({
entry: './api/api.esjs',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./api', import.meta.url)),
},
extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.esjs'],
},
build: {
outDir: './dist',
emptyOutDir: false,
rollupOptions: {
input: './api/api.esjs',
output: {
format: 'esm',
entryFileNames: 'servidor/[name].js',
chunkFileNames: 'servidor/[name].js',
assetFileNames: 'servidor/[name].[ext]',
exports: 'auto',
},
},
},
})