sparse-intern-71089
11/09/2021, 4:53 AMminiature-king-36473
11/09/2021, 8:40 AMrequire
to load the program. This means that all the code which is used must use commonJs and not newer es6 modules. I suspect that the package you are trying to use has not been compiled to commonJs - do you have "compilerOptions.module": "commonjs"
set in the module you are trying to import?
When you say "import a pulumi repo via a github url", are you trying to import the source code? In which can you probably need to build a package and import that (you could use github packages for this)steep-portugal-37539
11/09/2021, 5:40 PMsteep-portugal-37539
11/09/2021, 5:41 PMsteep-portugal-37539
11/09/2021, 5:44 PMindex.js
, right? Otherwise pulumi won’t be able to run the installed pkg.steep-portugal-37539
11/09/2021, 5:46 PMminiature-king-36473
11/10/2021, 11:08 AMexample
folder where I have a Pulumi program which can create these resources for testing purposes.
I then install these packages into other repositories which use these components in different environments. The advantage of this approach is I can keep my components versioned and easily track updates to the environments. The downside is lots of building of packages which can be tedious at times.
If you wanted to just reference the source code, you could probably use git submodules to bring the code into the current repository. I have never really got my head around those though and always seen to end up in a mess. YMMV though.miniature-king-36473
11/10/2021, 11:12 AMprepare
script that npm will run when you do an install
for a git url. This could run tsc
to build the code from the repository so that Pulumi can use it.steep-portugal-37539
11/10/2021, 9:07 PMminiature-king-36473
11/11/2021, 9:00 AM