-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (39 loc) · 1.04 KB
/
vite.config.ts
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
import path from 'path';
import devServer from '@hono/vite-dev-server';
import {defineConfig} from 'vite';
import build from '@hono/vite-build/bun'
export default defineConfig(({ mode }) => {
const globalConfig = {
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
};
if (mode === 'bundle') {
return {
...globalConfig,
build: {
rollupOptions: {
input: ['./src/bundle.ts', './src/style.css'],
output: {
entryFileNames: 'static/bundle.js',
assetFileNames: 'static/[name].[ext]',
},
},
},
};
} else {
return {
...globalConfig,
plugins: [
build({
entry: 'src/index.ts',
}),
devServer({
entry: 'src/index.ts',
}),
],
};
}
});