VSCode

2015-05-18 6 views
10

में टाइपस्क्रिप्ट निर्माण के दौरान `node_modules` फ़ोल्डर को अनदेखा कैसे करें मैं दृश्य स्टूडियो कोड आईडीई और टाइपस्क्रिप्ट का उपयोग कर रहा हूं, मैं इसे निर्माण के दौरान node_modules फ़ोल्डर को अनदेखा करने के लिए कैसे प्राप्त करूं? या इसे बचाने पर .ts फाइलें बनायें? यह बहुत सारी त्रुटियों को दिखा रहा है क्योंकि यह node_modules tsd संकलित करने का प्रयास कर रहा है।VSCode

वर्तमान में मेरी tasks.json

{ 
    "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" 
} 

उत्तर

6

है आप एक फ़ाइल सूची की आपूर्ति नहीं करते हैं, कोड सभी संकलित कर देगा।

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

आप केवल उन फ़ाइलों को आपूर्ति करके इसे बदल सकते हैं जिन्हें आप संकलित करना चाहते हैं।

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

उम्मीद है कि जल्द ही कोड filesGlob का समर्थन करेंगे, जो आप कुछ फ़ोल्डर से सभी फाइलों को हड़पने के लिए, जिसका अर्थ है कि आप सभी फ़ाइलों की एक वर्बोज़ सूची बनाने के लिए नहीं होगा पैटर्न का उपयोग करने की अनुमति देता है।

20

संस्करण 0.5 में आप hide files and folders

ओपन फ़ाइलों> वरीयताएँ-> उपयोगकर्ता सेटिंग और तरह

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

मामला यह नहीं है, दृश्य से यह केवल शामिल नहीं फ़ोल्डर छुपा यह इसे छिपाने नहीं है टीएससी कंपाइलर से। – httpete

+13

यूप, सवाल का जवाब नहीं, लेकिन वास्तव में मैं क्या देख रहा था! शायद आपको इसे एक नए प्रश्न के रूप में पोस्ट करना चाहिए;) – jluna

0

यहाँ कुछ जोड़ सकते हैं एक तरह से आप द्वारा प्राप्त करने के लिए किया जाता है, tsconfig का उपयोग नहीं करते .json अब के लिए यह समर्थन नहीं करता है जिसे आप की आवश्यकता होगी। मैं चाहता हूं कि आप tasks.json का उपयोग कर विकल्पों के साथ फ़ाइल को संकलित करना चाहते हैं। अभी के लिए आपको निर्माण करने के लिए CTRL + SHIFT + B करना है, अभी तक सहेजने के लिए कोई अच्छा तरीका नहीं है।

{ 

"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" 

} 
संबंधित मुद्दे