Przygotowuję maszynopis w Visual Studio 2015. Będę używał jquery z plikami TS. Kiedy używam jquery, VS podkreśli "$" i powie, że nie może znaleźć nazwy, i nie będzie budować pomyślnie. Jedyny sposób, w jaki zostanie skompilowany, to dodawanie odwołania do typowań jquery w każdym pliku TS. /// <reference path="typings/index.d.ts" />
Czy mimo to można używać tego odwołania globalnie zamiast dodawać je do każdego pliku?
W kodzie Visual Studio nie mam tego problemu.
Mój katalog wygląda następująco -Scripts --ts --- typowania --- main.ts tsconfig.json --js
mój plik tasks.json w korzeniu
{
"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": "silent",
// Tell the tsc compiler to use the tsconfig.json from the open folder.
"args": ["-p", "../Scripts/Weblink/ts"],
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
taskconfig.json skryptów/TS
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../lib/"
},
"exclude": [
"typings/*"
]
}
którą wersję maszynopisu używasz? – lenny
Najnowsza wersja 2.1.4 – stanggt3
Zainstalowany z plikiem VS z maszynopisu, a nie z Node – stanggt3