ts-morph
ts-morph copied to clipboard
[Question] how to automatically get JavaScript source files by package.json file ?
Hi, I'm working on some TS/JS projects, and this tool really helped me, in the meantime I'm working with projects that may contain JS/TS or both of them, on that purpose I hope to find a way of getting JS files on project by passing the package.json path the same way as for tsconfig.json (I haven't found any function like addSourceFilesFromPackage as addSourceFilesFromTsConfig), currently I'm adding files using glob patterns.
I think right now there is not a way to easily do that, but that would be a nice feature.
I could take a crack at this. I’m currently doing it with my codegen/bundler tooling. I’m using a hybrid of the TypeScript and Node module resolution strategies and it works well.