Configuring TypeScript

Transcript

English (Auto-generated)

talk about the the typescript began but basically we're going to configure the typescript accordingly. I mean what to configure, let's just discuss actually when we talk about the configuration of the typescript, so you know, you just created a variable here. This is why my name, string and whatever the data, this is the the string type, I mean the type of the variable, but later you created another variable, for example, are my number and I'm making it a number for now, so that is totally fine. I'm adding like, you know five here, I just saved it. Everything is okay. Now I um I'm just going to the terminal and I'm just writing T S C. Okay, now I can write the, you know the index dot T X T S but I just can write TSC that would work too. First I'm deleting this one and then we will do something like that. Okay, now we do not need to write the name of the file. Exactly. We just can write gsc and it would work similarly. So I'm just gonna press the enter key and it uh oh, something is not right? Oh, okay. Okay. So actually to use the TSC only, we have to do the configuration file first anyway, so let's just do the TSC let this clear it. Okay, now T S C N A space and then just right, index and press the line break and we're going to have the, you know, the end extra Js file. Okay, this was the original file and we just gotta convince the converted file into from T. S. two Js and this file is almost similar to this one identical but you know, um instead of making this as far I'm making it let left. Okay, now the LED is also a number and that is totally fine. I'm deleting this one first. Okay, now that is a number and uh I mean let let is a variable type but it's in the E S six, not in es five, so um how we don't know which which version we're getting the compiler compiling the file. So I'm just going there and I'm writing PSC and I'm writing index again and expressing the line break and then it is compiling and there is a the file now it is again converting it into the bar, not the elect. So I mean, you know that is that is not something specific to java to the typescript, let is something which is you know, have full impact on the javascript to. So when we are converting it into the javascript then let's should be there but why the letter is not there, That means the file, the converter is converting the files into, you know, not exactly the way we want but you know, kind of into the older version, it's not converting into the ES six, it's converting into the S five. So now we have we need to have the conflict file and in the conflict file we can, you know, we can do the configuration things. So I'm just going there. I'm just clearing it. TSC and uh the two hyphens and I N I T Okay, this initiates the configuration file so just press the enter key and there we got the T s conflict dot Jason. Okay. Here you have the options. You have many options But most of the options are green. So you do not need to do anything with the green ones. You just can change the data of the of like this one, the target, you know, actually the target is 2,016 now, which means it is after the configuration. It is now targeting the um the the 2006 years, 2016 means we are targeting the es seven, that means absolutely we're going to have the let so anyway, the modules, you know, the module can be anything, you know, if you want to change the module from the commandant Chase, you can change that. There are a few more things like, you know, if you just want to use the image then yeah, like the out file, the Audi I or the source map. These files are important. We will be talking about them. So if you just want to remove the comments and you know, there are things which you need and you can, you know, you can put the configuration from here. So you want to make it district. Yeah, I just, you know, by default, it's true. The district is true by default. So there are many options. We are absolutely gonna I'm gonna use some of the options given here anyway. I'm just gonna go back, I'm just gonna go there and I'm just gonna clean everything and I'm gonna just, you know, I'm just gonna write the TSC index. Actually, first I need to see this is led and this one is far, I'm going to delete this one, the original uh the compiled one. And I'm I'm I'm going to do the same again but now there is a file but it won't work. I mean it's still the bar. Okay. You want to involve this file actually if you want to involve the file then you you you know, you have to delete first. Deleting. Delusion is not necessary. I'm just deleting because you know, I just don't want to confuse anybody. Now, you just need to write the PSC. You do not need to put the name of the file so the PSC and press the enter key. And now we are going to have the the conversion and this conversion has the let so um you know, because of the congress because of the, you know, t. S conflict, we know, I mean what we need to convert. So maybe there would be more T. S. Files and in that way the TSC would only converse would convert every each of the file, all of the files actually. Okay, so um now we're just using the TSC to target the, you know, to to use the compiler with the the the T. S. Conflict adjacent file with the methods anyway, maybe you have some something, you wrote something in the T. S. File, which you want to become, you know, compiled into the javascript, but They may be from the, you know, ES 2017 years, 2018. So you can absolutely apply them by changing the target types. So that is, I mean, you know, pretty simple and you absolutely can use the other configuration options. We're going to use some. So that is totally fine. So in the next video we're absolutely going to talk about something else until then stay tuned.
121 Views 0 Likes 0 Comments

Configuring TypeScript

Comment
Leave a comment (supports markdown format)