Skip to content

Commit 989bd9c

Browse files
committed
docs: add features.componentIdGenerator option
1 parent 3281ed2 commit 989bd9c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/plugin-vue/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ export interface Options {
5858
* - **default:** `false`
5959
*/
6060
prodHydrationMismatchDetails?: boolean
61+
/**
62+
* Customize the component ID generation strategy.
63+
* - `'filepath'`: hash the file path (relative to the project root)
64+
* - `'filepath-source'`: hash the file path and the source code
65+
* - `function`: custom function that takes the file path, source code,
66+
* whether in production mode, and the default hash function as arguments
67+
* - **default:** `'filepath'` in development, `'filepath-source'` in production
68+
*/
69+
componentIdGenerator?:
70+
| 'filepath'
71+
| 'filepath-source'
72+
| ((
73+
filepath: string,
74+
source: string,
75+
isProduction: boolean | undefined,
76+
getHash: (text: string) => string,
77+
) => string)
6178
}
6279

6380
// `script`, `template` and `style` are lower-level compiler options

0 commit comments

Comments
 (0)