See my blog post for details: How to set up a typescript project for Power Apps Web Resources
npm install
npx webpack
This will build typescript code and bundle the javascript into js files and place them in the dist folder
- Deploy the js files from
distfolder as web resources in Power Apps - Define the function name with pattern
[LibraryName].[FunctionName](e.g.Account.accountOnLoad) in Power Apps handler