-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
91 lines (90 loc) · 2.64 KB
/
vite.config.ts
File metadata and controls
91 lines (90 loc) · 2.64 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import path from 'node:path';
import { reactRouter } from '@react-router/dev/vite';
import { reactRouterHonoServer } from 'react-router-hono-server/dev';
import { defineConfig } from 'vite';
import babel from 'vite-plugin-babel';
import tsconfigPaths from 'vite-tsconfig-paths';
import { addRenderIds } from './plugins/addRenderIds';
import { aliases } from './plugins/aliases';
import consoleToParent from './plugins/console-to-parent';
import { layoutWrapperPlugin } from './plugins/layouts';
import { loadFontsFromTailwindSource } from './plugins/loadFontsFromTailwindSource';
import { nextPublicProcessEnv } from './plugins/nextPublicProcessEnv';
import { restart } from './plugins/restart';
import { restartEnvFileChange } from './plugins/restartEnvFileChange';
export default defineConfig({
envPrefix: 'NEXT_PUBLIC_',
optimizeDeps: {
// Explicitly include fast-glob, since it gets dynamically imported and we
// don't want that to cause a re-bundle.
include: ['fast-glob', 'lucide-react'],
exclude: [
'@hono/auth-js/react',
'@hono/auth-js',
'@auth/core',
'@hono/auth-js',
'hono/context-storage',
'@auth/core/errors',
'fsevents',
'lightningcss',
],
},
logLevel: 'info',
plugins: [
nextPublicProcessEnv(),
restartEnvFileChange(),
reactRouterHonoServer({
serverEntryPoint: './__create/index.ts',
runtime: 'node',
}),
babel({
include: ['src/**/*.{js,jsx,ts,tsx}'], // or RegExp: /src\/.*\.[tj]sx?$/
exclude: /node_modules/,
babelConfig: {
babelrc: false, // don't merge other Babel files
configFile: false,
plugins: ['styled-jsx/babel'],
},
}),
restart({
restart: [
'src/**/page.jsx',
'src/**/page.tsx',
'src/**/layout.jsx',
'src/**/layout.tsx',
'src/**/route.js',
'src/**/route.ts',
],
}),
consoleToParent(),
loadFontsFromTailwindSource(),
addRenderIds(),
reactRouter(),
tsconfigPaths(),
aliases(),
layoutWrapperPlugin(),
],
resolve: {
alias: {
lodash: 'lodash-es',
'npm:stripe': 'stripe',
stripe: path.resolve(__dirname, './src/__create/stripe'),
'@auth/create/react': '@hono/auth-js/react',
'@auth/create': path.resolve(__dirname, './src/__create/@auth/create'),
'@': path.resolve(__dirname, 'src'),
},
dedupe: ['react', 'react-dom'],
},
clearScreen: false,
server: {
allowedHosts: true,
host: '0.0.0.0',
port: 4000,
hmr: {
overlay: false,
},
warmup: {
clientFiles: ['./src/app/**/*', './src/app/root.tsx', './src/app/routes.ts'],
},
},
});