1

Is it possible to compile typescript in Visual Studio to single file (with MsBuild). I am using Visual Studio Community 2015, with typescript 1.8.9.

Setting <TypeScriptOutFile>bundle.js</TypeScriptOutFile> doesn' t work, cause I am using CommonJS modules.

1 Answer 1

1

No you can not

From Why not supported outFile parameter on CommonJS

I quote from mhegazy:

"CommonJs expects files to exist at certain places, and changing their location breaks how they are loaded. moreover CommonJs/node modules have different scoping rules than script files, and concatenating them breaks that, so the only way to do this correctly is to wrap them in functions, and add a loader, which is pretty much AMD or system.js."

Then if you want to use one output file name use AMD..

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

Comments

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.