diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index d30a45c45f461a808fd8290c984bd50c290e1f74..fb7272e1547d2c3497d92ad13bc0ecf0bb5d16c0 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -43,6 +43,7 @@ import { import { tryMangleFileName, writeObfuscatedSourceCode, + writeFileSyncCaseAware, } from '../../ark_utils'; import { AOT_FULL, AOT_PARTIAL, AOT_TYPE } from '../../pre_define'; import { SourceMapGenerator } from './generate_sourcemap'; @@ -185,7 +186,7 @@ export async function writeFileContentToTempDir(id: string, content: string, pro case EXTNAME_JSON: const newFilePath: string = tryMangleFileName(filePath, projectConfig, id, projectConfig.isBytecodeObfEnabled); mkdirsSync(path.dirname(newFilePath)); - fs.writeFileSync(newFilePath, content ?? ''); + writeFileSyncCaseAware(newFilePath, content ?? ''); break; default: break; @@ -208,7 +209,7 @@ async function writeFileContent(sourceFilePath: string, filePath: string, conten return; } mkdirsSync(path.dirname(filePath)); - fs.writeFileSync(filePath, content, 'utf-8'); + writeFileSyncCaseAware(filePath, content, 'utf-8'); } export function getEs2abcFileThreadNumber(): number { diff --git a/compiler/src/interop/src/fast_build/ark_compiler/utils.ts b/compiler/src/interop/src/fast_build/ark_compiler/utils.ts index 71ab93ef0cb2e9eddd33dd1a5716b3ee2bd205fb..24aa9a6bed755c61d9773989991a5c8a70fa59a1 100644 --- a/compiler/src/interop/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/interop/src/fast_build/ark_compiler/utils.ts @@ -44,6 +44,7 @@ import { import { tryMangleFileName, writeObfuscatedSourceCode, + writeFileSyncCaseAware, } from '../../ark_utils'; import { AOT_FULL, AOT_PARTIAL, AOT_TYPE } from '../../pre_define'; import { SourceMapGenerator } from './generate_sourcemap'; @@ -186,7 +187,7 @@ export async function writeFileContentToTempDir(id: string, content: string, pro case EXTNAME_JSON: const newFilePath: string = tryMangleFileName(filePath, projectConfig, id, projectConfig.isBytecodeObfEnabled); mkdirsSync(path.dirname(newFilePath)); - fs.writeFileSync(newFilePath, content ?? ''); + writeFileSyncCaseAware(newFilePath, content ?? ''); break; default: break; @@ -209,7 +210,7 @@ async function writeFileContent(sourceFilePath: string, filePath: string, conten return; } mkdirsSync(path.dirname(filePath)); - fs.writeFileSync(filePath, content, 'utf-8'); + writeFileSyncCaseAware(filePath, content, 'utf-8'); } export function getEs2abcFileThreadNumber(): number { diff --git a/compiler/src/interop/src/process_module_files.ts b/compiler/src/interop/src/process_module_files.ts index 2a8e3a07702a8b0d21cabc81dc8122521ff0a0ee..e0612314ec1a13e39fdad66a2c4d29952f021357 100644 --- a/compiler/src/interop/src/process_module_files.ts +++ b/compiler/src/interop/src/process_module_files.ts @@ -31,6 +31,7 @@ import { newSourceMaps as webpackNewSourceMaps, transformModuleSpecifier, writeObfuscatedSourceCode, + writeFileSyncCaseAware, } from './ark_utils'; import { processSystemApi } from './validate_ui_syntax'; import { isDebug } from './fast_build/ark_compiler/utils'; @@ -94,7 +95,7 @@ export async function writeFileSyncByNode(node: ts.SourceFile, projectConfig: Ob return; } mkdirsSync(path.dirname(temporaryFile)); - fs.writeFileSync(temporaryFile, mixedInfo.content); + writeFileSyncCaseAware(temporaryFile, mixedInfo.content); stopEvent(eventWriteFileSyncByNode); } diff --git a/compiler/src/process_module_files.ts b/compiler/src/process_module_files.ts index 2a8e3a07702a8b0d21cabc81dc8122521ff0a0ee..e0612314ec1a13e39fdad66a2c4d29952f021357 100644 --- a/compiler/src/process_module_files.ts +++ b/compiler/src/process_module_files.ts @@ -31,6 +31,7 @@ import { newSourceMaps as webpackNewSourceMaps, transformModuleSpecifier, writeObfuscatedSourceCode, + writeFileSyncCaseAware, } from './ark_utils'; import { processSystemApi } from './validate_ui_syntax'; import { isDebug } from './fast_build/ark_compiler/utils'; @@ -94,7 +95,7 @@ export async function writeFileSyncByNode(node: ts.SourceFile, projectConfig: Ob return; } mkdirsSync(path.dirname(temporaryFile)); - fs.writeFileSync(temporaryFile, mixedInfo.content); + writeFileSyncCaseAware(temporaryFile, mixedInfo.content); stopEvent(eventWriteFileSyncByNode); }