This message was deleted.
# typescript
s
This message was deleted.
g
I get a feeling this is not possible and only way to get everything running the way I want is to use different projects and maybe use shell scripts or whatever to make the login process less painful
Or... Maybe one could write a generic
index.ts
, then in code inspect which stack is in use and then dynamically import the subfolder
index.ts
or similar... But sounds a bit like a hack that is not going to end up well
Guess I'll have to bite the bullet and just model this as separate projects even if I wanted to avoid that
At least Pulumi
node_modules
isn't insane in size šŸ˜‚
w
but I faced a problem where Pulumi expects
index.ts
to be in the root of the project
Not sure if this will help, but you can point Pulumi to a different file than index.ts or index.js in
package.json
https://www.pulumi.com/docs/intro/languages/javascript/#entrypoint
You might be able to redirect the entrypoint at a per-stack level like Mikhail suggested here: https://github.com/pulumi/pulumi/issues/10022#issuecomment-1172084007 Mikhail uses
Pulumi.yml
but you might be able to change
main
in
Pulumi-dev.yml
,
Pulumi-prod.yml
etc. I doubt that, though. It’s also possible ā€œhierarchical configā€ might give you the flexibility you want. That’s on the roadmap for Q4. Not completely sure that will give you what you want either tbh.
g
Thanks for suggestions! I was aware of the package.json configuration but in this case that doesn't help since you can only do that for single index.ts file. Also Mikhail's approach isn't same either. But that is ok, I think I'll just bite the bullet and do several projects. Should avoid issues in the future with the cost of small inconvenience.
šŸ‘ 1
w
Best of luck! Hopefully we can make your life easier with hierarchical config in the future!
l
You can use a mono-repo with multiple pulumi projects and a single npm project. You just have to be creative with your tsconfigs etc.
I do this. The only gotcha that I've found so far is that if your project uses Pulumi to bundle a lambda or similar cloud function, you'll get another node_modules from that. It's for the lambda only; the Pulumi project can still use the root node_modules.