mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-19 16:43:34 -04:00
!5 fix worker same filename bug
Merge pull request !5 from 卡哥/monthly_20220816
This commit is contained in:
+9
-1
@@ -298,7 +298,15 @@ function readWorkerFile() {
|
||||
}
|
||||
const relativePath = path.relative(projectConfig.projectPath, worker);
|
||||
if (filterWorker(relativePath)) {
|
||||
workerFileEntry[relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/')] = worker;
|
||||
const workerKey = relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/');
|
||||
if (workerFileEntry[workerKey]) {
|
||||
throw Error(
|
||||
'\u001b[31m ERROR: The worker file cannot use the same file name: \n' +
|
||||
workerFileEntry[workerKey] + '\n' + worker + '\u001b[39m'
|
||||
).message;
|
||||
} else {
|
||||
workerFileEntry[workerKey] = worker;
|
||||
}
|
||||
}
|
||||
});
|
||||
return workerFileEntry;
|
||||
|
||||
Reference in New Issue
Block a user