forked from IndexXuan/vite-plugin-mpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.ts
41 lines (38 loc) · 857 Bytes
/
options.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
/**
* MPA Plugin options.
*/
import type { Rewrite } from 'connect-history-api-fallback'
export interface MpaOptions {
/**
* open path for viteDevServer
* this plugin will try to open first page for you, but you can still custom, e.g. /index#/about
* @default firstPagePath
*/
open: string | boolean
/**
* where to scan
* @default 'src/pages'
*/
scanDir: string
/**
* scanFile
* @default 'main.{js,ts,jsx,tsx}'
*/
scanFile: string
/**
* html filename, yarn crate @vitejs/app => projectRoot/index.html or MPA projectRoot/pages/${pageName}/index.html
* @default 'index.html'
*/
filename: string
/**
* default included entry
* @default ''
*/
defaultEntries: string
/**
* rewrite rule list
* @default []
*/
rewrites: Rewrite[]
}
export type UserOptions = Partial<MpaOptions>