0

I am trying to compile multiple typescript files on a Windows machine from the command prompt (using this procedure). I have created a file ts.txt with the following content:

--module amd
-target ES5
dir *.ts /b /s

I then run the following command:

tsc @ts.txt

Then I get the following errors:

error TS5007: Cannot resolve referenced file: 'dir'.
error TS5007: Cannot resolve referenced file: '*.ts'.
error TS5007: Cannot resolve referenced file: '/b'.
error TS5007: Cannot resolve referenced file: '/s'.

If I move the two typescript options to the command line instead of having them in the file, i still get the same error. What am I doing wrong?

I am using typescript 1.0.1.0.

1 Answer 1

1

It appears that the @ parameter is for TypeScript command line options, not Windows CMD line options. I couldn't find a nice concise option of what it actually accepts but I'm gussing it takes the file names from a list and the other tsc options appended. Such as '*.ts --noImplicitAny'.

I changed the file ts.txt to;

--module amd
-target ES5
*.ts

and it works, make sure you have .ts files in the wildcard path otherwise it will still bork.

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

3 Comments

I tried changing the file as you suggested, and I got the same error, now only for the '*.ts'. If I replace the * with an file name it works.
Is the file in the current directory? It errored for me when it could not find the ts file.
Yes the file should contain the exact same arguments as you would pass otherwise. e.g. if you can do --module amd --target ES5 *.ts The file contents should be the same and the compilation result will be the same.

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.