2015-05-18 14 views
10

Görsel stüdyo kodu IDE ve typescript kullanıyorum, yapı sırasında node_modules klasörünü yoksaymak için nasıl alabilirim? Ya da kaydetme .ts dosyaları var mı? Node_modules tsd'yi derlemeye çalıştığı için çok sayıda hata gösteriyor.VSCode içinde TypeScript oluşturma sırasında node_modules` klasörünü gözardı etme

Şu anda benim tasks.json bir dosya listesi sağlamazsanız, Kod tüm derleyecek

{ 
    "version": "0.1.0", 

    // The command is tsc. 
    "command": "tsc", 

    // Show the output window only if unrecognized errors occur. 
    "showOutput": "silent", 

    // Under windows use tsc.exe. This ensures we don't need a shell. 
    "windows": { 
     "command": "tsc.exe" 
    }, 

    "isShellCommand": true, 

    // args is the HelloWorld program to compile. 
    "args": [], 



    // use the standard tsc problem matcher to find compile problems 
    // in the output. 
    "problemMatcher": "$tsc" 
} 

cevap

6

olduğunu.

{ 
    "compilerOptions": { 
     "target": "ES5" 
    } 
} 

Yalnızca, derlemek istediğiniz dosyaları sağlayarak bunu değiştirebilirsiniz.

{ 
    "compilerOptions": { 
     "target": "ES6" 
    }, 
    "files": [ 
     "app.ts", 
     "other.ts", 
     "more.ts" 
    ] 
} 

Umarım Kod yakında tüm dosyaların bir ayrıntılı liste oluşturmak zorunda olmayacak anlamına gelir belli klasörlerdeki tüm dosyaları kapmak için desenleri kullanmak olanak veren filesGlob destekleyecektir. Sürüm 0.5 olarak

20

Eğer hide files and folders

Açık Dosyaları Sil-> Tercihler-> Kullanıcı Ayarları ve tsconfig kullanmayın, İşte

{ 
     "files.exclude": { 
      "**/.git": true, 
      "**/.DS_Store": true, 
      "jspm_packages" : true, 
      "node_modules" : true 
     } 
} 
+0

Bu durum böyle değil, klasör gizleme görünümünden bu sadece dışlayan bunu saklamıyor tsc derleyicisinden. – httpete

+13

Evet, sorunun cevabı değil, tam olarak aradığım şey! Belki de yeni bir soru olarak göndermelisiniz;) – jluna

0

gibi bir şey sizi almanın bir yolu olduğunu ekleyebilir .json şimdilik ihtiyacınız olan hariç tutmayı desteklemiyor. İstediğim şey, yalnızca bulunduğunuz dosyayı task.json kullanarak seçenekler ile derlemek. Şimdilik, CTRL + ÜSTKRKT + B'ye sahip olmanız gerekiyor, henüz kaydetme üzerine kurmanın güzel bir yolu yok.

{ 

"version": "0.1.0", 

// The command is tsc. Assumes that tsc has been installed using npm install -g typescript 
"command": "tsc", 

// The command is a shell script 
"isShellCommand": true, 

// Show the output window only if unrecognized errors occur. 
"showOutput": "always", 

// args is the HelloWorld program to compile. 
"args": ["${file}", "--module", "amd", "--target", "ES5"], 


// use the standard tsc problem matcher to find compile problems 
// in the output. 
"problemMatcher": "$tsc" 

} 
İlgili konular