1

I am trying to use typescript in webstorm, I've done almost except "arranging js files in the folder structure that repeats the original structure of .ts files".

I've used the command which is given in site https://www.jetbrains.com/webstorm/help/using-file-watchers.html#generalOptions for coffiescript.

Below are commends showed in websites:

Arguments : --output $ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\ --compile --map $FileName$

Output path for refresh :

$ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js:$ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.map

I've used above commend with little change as per my project.But i'm getting error on console.

Here i've attached both the my configuration of File watchers img and error in console img.

my file watcher Image & Error in Console Image
http://pho.to/9fH8J

Below is the commands which used in my file watcher "arguments" and "output paths to refers"

Arguments : --output $ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\ --compile --map $FileName$

Output paths for refers :

$ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js:$ProjectFileDir$\js\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js.map

*Typescript are installed in project level, not globally installed.

Help me out from this.

1 Answer 1

3

The example provided in the WebStorm help is for CoffeeScript compiler that has different command-line options. With TypeScript compiler use --sourceMap to generate source maps and --out to specify the output file. Here you can find information about TypeScript compiler and it's options: https://github.com/Microsoft/TypeScript/wiki/Compiler-Options If you're using WebStorm 10, use a built-in TypeScript compiler instead of a file watcher.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks progara..is there way to create folder dynamically in Typescript as if Coffeescript? and one more : file watcher and bulit in Typescript compiler both are doing same..but is there any important feature in bulit in Typescript compiler than file watcher...share me your thoughts
You can try tsc with --outDir param that redirect output structure to the directory.
The benefit of using a built-in compiler compered to a file watcher is that it doesn't start a new compilation process on every change, so works faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.