-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
62 lines (60 loc) · 1.64 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// <reference types="vitest" />
import devServer, { defaultOptions } from '@hono/vite-dev-server';
import { vitePlugin as remix } from '@remix-run/dev';
import { defineConfig } from 'vite';
import styleX from 'vite-plugin-stylex';
import { configDefaults } from 'vitest/config';
export default defineConfig({
server: {
// @UPDATE - rename host to whatever domain you're using
host: 'local.example-test.com',
port: 3_000,
https: {
key: './.cert/cert.key',
cert: './.cert/cert.crt',
},
warmup: {
clientFiles: [
'./src/remix-app/entry.client.tsx',
'./src/remix-app/root.tsx',
'./src/remix-app/routes/**/*',
'!./app/routes/**/*.test.{ts,tsx}',
],
},
},
optimizeDeps: {
include: ['./src/remix-app/routes/**/*'],
},
plugins: [
devServer({
injectClientScript: false,
entry: 'src/hono-server/server.ts',
exclude: [...defaultOptions.exclude, /.*\.css\?url$/],
}),
!process.env.VITEST &&
remix({
ignoredRouteFiles: ['**/.*'],
appDirectory: 'src/remix-app',
serverModuleFormat: 'esm',
}),
// @FIXME - Hit some strange type errors with this plugin, but seems to work fine
// @ts-ignore
styleX(),
],
test: {
include: ['./src/**/*.test.{ts,tsx}'],
environment: 'jsdom',
coverage: {
provider: 'v8',
exclude: [...configDefaults.exclude, '**/__tests__/**', '**/dist/**', '**/public/**'],
thresholds: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
reporter: ['lcov', 'json', 'html'],
},
reporters: ['default'],
},
});