Upgrading Azure Functions from V3 to V4 when both JavaScript and TypeScript Files are there in same folder

How can the Azure Function version be upgraded from V3 to V4 when both JavaScript and TypeScript files are maintained in the same folder structure? Below is the folder structure for the V3 model.
[folder structure in azure function v3 model]

<project_root>/
 | - .vscode/
 | - dist/
 | - node_modules/
 | - myFirstFunction/
 | | - index.ts
 | | - function.json
 | - mySecondFunction/
 | | - index.ts
 | | - function.json
 | - myThirdFunction/
 | | - index.js
 | | - function.json
 | - .funcignore
 | - host.json
 | - local.settings.json
 | - package.json
 | - tsconfig.json

Additionally, how should the path value for the **main **key in the package.json file be specified for the Azure Function V4 model when both JavaScript and TypeScript files are present in the same folder?

“main”: “dist/src/functions/*.js”

Tried building the root folder and typescript files are converted to JavaScript and moved to dist folder but javascript files are stored in the same folder. After build is generated, how to run the converted JS files from dist folder and jas files from root folder.