Hi all, are there any examples of using pulumi wit...
# general
p
Hi all, are there any examples of using pulumi with typescript and ESM. I can see there was support added but there are no docs on this. Thanks
f
I don't have any docs, but I've managed to get this working. Happy to share my tsconfig.json if that would help?
p
Yeah that would be great, I've tried a few different things but still unsuccessful
f
Make sure you've got
"type": "module"
in your
package.json
file. Here's what I have in my root `tsconfig.json`:
Copy code
{
	"compilerOptions": {
		// Versioning
		"target": "es2022",
		"module": "NodeNext",
		"moduleResolution": "NodeNext",
		
		// Assume dependencies are OK
		"skipLibCheck": true,
		
		// No auto includes - only node
		"types" : ["node"],

		// Performance
		"composite": true,
		
		// Strict Checking
		"allowUnreachableCode": false,
		"allowUnusedLabels": false,
		"checkJs": false, // do not check js
		"exactOptionalPropertyTypes": true,
		"experimentalDecorators": true,
		"forceConsistentCasingInFileNames": true,
		"verbatimModuleSyntax": true,
		"noFallthroughCasesInSwitch": true,
		"noImplicitOverride": true,
		"noImplicitReturns": true,
		"noPropertyAccessFromIndexSignature": true,
		"noUncheckedIndexedAccess": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"pretty": true,
		"strict": true,
		"isolatedModules": true
	}
}