javascript - How do I add TypeScript files in a Django project made with Visual Studio 2019 - Stack Overflow

Is it possible to use TypeScript instead of JavaScript in a Django project developed using Visual Studi

Is it possible to use TypeScript instead of JavaScript in a Django project developed using Visual Studio?

At the moment I just tried to add a .ts file and import it to a HTML file. It fails when finding non-Javascript syntax though. I was wondering what I was missing.

Do I have to configuration Visual Studio for it? (TypeScript sdk is already installed).
Is it going to pile the .ts files into JavaScript by itself or do I have to go through extra steps?

Is it possible to use TypeScript instead of JavaScript in a Django project developed using Visual Studio?

At the moment I just tried to add a .ts file and import it to a HTML file. It fails when finding non-Javascript syntax though. I was wondering what I was missing.

Do I have to configuration Visual Studio for it? (TypeScript sdk is already installed).
Is it going to pile the .ts files into JavaScript by itself or do I have to go through extra steps?

Share Improve this question asked Feb 16, 2020 at 11:52 Alvin SartorAlvin Sartor 2,4794 gold badges24 silver badges42 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

You are going to have to pile your Typescript files in Javascript files.

The best way to do this is to use the tsc mand available to you when installing typescript with a package manager like NPM.

Make sure you then import your Javascript files in your HTML files. If you're using Django Templates, then use Static Files to link to the appropriate Javascrpt files.

I hope this helps you :)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744081605a4555398.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信