-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
48 lines (45 loc) · 1.46 KB
/
Copy pathvite.config.ts
File metadata and controls
48 lines (45 loc) · 1.46 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
import { defineConfig } from 'vite-plus';
import oxfmtConfig from './.oxfmtrc.json' with { type: 'json' };
import oxlintConfig from './.oxlintrc.json' with { type: 'json' };
type VitePlusConfig = Exclude<Parameters<typeof defineConfig>[0], Promise<unknown> | Function>;
const baseOxfmtConfig = oxfmtConfig as NonNullable<VitePlusConfig['fmt']>;
const baseOxlintConfig = oxlintConfig as unknown as NonNullable<VitePlusConfig['lint']>;
const runCopyCheck = () => 'vp run copycheck';
export default defineConfig({
resolve: {
alias: {
'@threadry/db': new URL('./packages/db/src/index.ts', import.meta.url).pathname,
'@threadry/domain': new URL('./packages/domain/src/index.ts', import.meta.url).pathname,
'@threadry/runner': new URL('./apps/tools/runner/src/index.ts', import.meta.url).pathname,
'@threadry/server': new URL('./apps/server/src/index.ts', import.meta.url).pathname,
},
},
staged: {
'*': 'vp check --fix',
'*.{js,jsx,ts,tsx,css}': runCopyCheck,
},
fmt: baseOxfmtConfig,
lint: baseOxlintConfig,
test: {
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/e2e/**',
],
},
run: {
cache: true,
tasks: {
doctor: {
command: 'npx -y react-doctor@latest . --verbose',
cache: false,
},
copycheck: {
command: 'vp exec jscpd --config .jscpd.json .',
cache: false,
},
},
},
});