Summary
Update TypeScript template devDependencies to match Node.js 22 runtime and modernize TypeScript configuration.
Current State
package.json:
{
"main": "dist/src/functions/*.js",
"devDependencies": {
"azure-functions-core-tools": "^4.x",
"@types/node": "18.x",
"typescript": "^4.0.0",
"rimraf": "^5.0.0"
}
}
tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6"
}
}
Proposed Changes
package.json:
{
"main": "dist/src/{index.js,functions/*.js}",
"devDependencies": {
"azure-functions-core-tools": "^4.x",
"@types/node": "^22.x",
"typescript": "^5.0.0",
"rimraf": "^5.0.0"
}
}
tsconfig.json:
{
"compilerOptions": {
"module": "Node16",
"target": "ES2022",
"moduleResolution": "Node16",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}
Why These Changes?
| Change |
Reason |
@types/node 18→22 |
Type definitions should match runtime version |
typescript 4→5 |
Latest stable with better performance |
target: ES2022 |
Node 22 supports ES2022 features natively |
module: Node16 |
Better ESM/CJS interop for modern Node.js |
main glob pattern |
Include index.js for functions registered there |
Testing Checklist
Reference
Summary
Update TypeScript template devDependencies to match Node.js 22 runtime and modernize TypeScript configuration.
Current State
package.json:
{ "main": "dist/src/functions/*.js", "devDependencies": { "azure-functions-core-tools": "^4.x", "@types/node": "18.x", "typescript": "^4.0.0", "rimraf": "^5.0.0" } }tsconfig.json:
{ "compilerOptions": { "module": "commonjs", "target": "es6" } }Proposed Changes
package.json:
{ "main": "dist/src/{index.js,functions/*.js}", "devDependencies": { "azure-functions-core-tools": "^4.x", "@types/node": "^22.x", "typescript": "^5.0.0", "rimraf": "^5.0.0" } }tsconfig.json:
{ "compilerOptions": { "module": "Node16", "target": "ES2022", "moduleResolution": "Node16", "outDir": "dist", "rootDir": ".", "sourceMap": true, "strict": true, "esModuleInterop": true, "skipLibCheck": true } }Why These Changes?
@types/node18→22typescript4→5target: ES2022module: Node16mainglob patternTesting Checklist
npm installsucceedsnpm run buildcompiles without errorsfunc startdiscovers all functionsazd updeploys successfullyReference