File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
bundler-shared-config/src
preset-bundler/src/features/configPlugins Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,13 @@ import { CHAIN_ID } from '@kmijs/bundler-shared'
44import type { SharedConfigOptions } from '../types'
55
66export function applyCaseSensitivePaths ( opts : SharedConfigOptions ) {
7- const { config } = opts
7+ const { config, userConfig } = opts
8+
9+ // 如果用户明确设置为 false,则跳过插件应用
10+ if ( userConfig . caseSensitivePaths === false ) {
11+ return
12+ }
13+
814 // 文件大小写
915 config . plugin ( CHAIN_ID . PLUGIN . CASE_SENSITIVE_PATHS ) . use ( CaseSensitivePaths )
1016}
Original file line number Diff line number Diff line change @@ -167,6 +167,12 @@ export interface IUserConfig {
167167 host ?: string
168168 port ?: number
169169 }
170+
171+ /**
172+ * 是否启用文件路径大小写敏感检查
173+ * @default true
174+ */
175+ caseSensitivePaths ?: boolean
170176}
171177
172178export interface SharedConfigOptions {
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ export const schema = defineKmiConfigSchema({
99 . boolean ( )
1010 . optional ( )
1111 . describe ( '关闭不存在的导出或存在冲突的重导出时报错校验, 默认开启' ) ,
12+ caseSensitivePaths : ( { zod } ) =>
13+ zod
14+ . boolean ( )
15+ . optional ( )
16+ . describe ( '是否启用文件路径大小写敏感检查,设置为 false 可关闭检查' ) ,
1217} )
1318
14- export const configDefaults : Record < string , any > = { }
19+ export const configDefaults : Record < string , any > = {
20+ caseSensitivePaths : true ,
21+ }
You can’t perform that action at this time.
0 commit comments