Hey Guys! If I’m using TypeScript with Pulumi, wha...
# typescript
e
Hey Guys! If I’m using TypeScript with Pulumi, what is the latest 
target
 I can use? Currently the default seems to be 
es2016
. Is there any reason why won’t I bump it to 
es2020
? Also, as for the 
module
 definition, can I use 
ES2020
 or 
ESNext
?
l
Check out the notes at the bottom of this page: https://www.pulumi.com/docs/intro/languages/javascript/
Essentially, you can configure anything you like for module and target; your IDE will use those.
Pulumi will use target es6 and module commonjs, unless you turn off Typescript support.
e
Hey!
l
You should lose no functionality if you turn off the built-in Typescript support, you just have to manage all the options yourself.
e
What is the best practice?
The app was generated with
es2016
and not
es6
l
If you're confident in your tsconfig / register=ts-node magic, then manage it yourself, you'll get your own preferred environment.
Ah, maybe they've update that to es2016 but forgot to update the docs.
e
And how do I pipe it to pulumi?
l
There is no best practice, I think. It's a bit like deciding between using the aws and awsx packages when buliding your VPC. Both are good, you just pick which is right for you.
e
I guess I would need to compile it on my own and pipe the results to pulumi
b
generally you'd run your typescript program with the pulumi CLI, unless you're using the Pulumi CLI
e
I’m slightly confused. If I want the lambdas to contain the most minimal possible code, I would like it to use native JS code instead of transpiling it
how can I use custom
tsconfig
options while piping the output to pulumi cli?
b
would be good to get a little context on what your desired goal is
e
@billowy-army-68599 Right now it seems like the built-in typescript support is for
commonjs
modules and
es2016
which is good but it transpiles the code into a less readable code. I would like to know if it’s possible to transpile the code into a “modern” JS syntax