خطأ TypeScript: "Cannot write file ... because it would overwrite input file" في Visual Studio
مرحباً بالجميع! أنا مبتدئ في TypeScript، وأكتب به في Visual Studio 2015. قمت بتثبيت TypeScript 2.0 عبر NuGet. أنشأت مشروعاً بسيطاً يحتوي على ملف واحد app.ts:
function greet(name: string) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
في tsconfig.json لدي الإعدادات التالية:
{
"compilerOptions": {
"target": "es5",
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"src/**/*"
]
}
الملف app.ts موجود في مجلد src. عند محاولة بناء المشروع (Ctrl+Shift+B) أحصل على الخطأ:
Cannot write file 'C:/Projects/MyApp/dist/app.js' because it would overwrite input file.
لقد تأكدت: في مجلد dist لا توجد أي ملفات .ts. لماذا يعتقد المترجم أنه يستبدل ملف الإدخال؟ كيف يمكن إصلاح ذلك؟ جربت حذف المجلدات