Hello, How do you organize your pulumi code with T...
# typescript
c
Hello, How do you organize your pulumi code with Typescript ? I have 1 index.ts with hundreds of lines of code... Any best pratices on that ?
f
Do you have any preferences on CommonJS vs ESM modules? I have a whole spiel about monorepos and NX and the automation API; but for your case just splitting into multiple files would be a great starting point
Do you have a
package.json
file? Does it have a line that says
"type": "module"
?
l
Also read up on ComponentResources. One resource type per module is very easy to manage.
And you can group modules into packages, if you need to. If you have only one project, then you don't need to. Multiple projects using the same resource types is the use case for packages.