fulls1z3 / azure-functions-typescript

Seed project for backend development on Azure Functions with TypeScript
MIT License
45 stars 14 forks source link

automatic detection of functions by webpack #53

Open amrfarid140 opened 6 years ago

amrfarid140 commented 6 years ago

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[x] Feature request
[ ] Documentation issue or request

Current behavior As far as I understand, with the current Webpack configuration will need to be updated every time a new Function is created. It makes life difficult, especially when you are migrating an existing project to use this template.

Expected/desired behavior

Automatically detect functions under src directory and bundle them invidually.

This can be achieved by adding an extra helper method to get all the directories under src and create webpack entry object.

To make things smooth, I used Parllel Webpack to do the bundling in parallel.

I already have such setup working in my project and I would be more than happy to share the setup if you are intersted.

fulls1z3 commented 6 years ago

@amrfarid140 although the aim is not to include a great number of functions within a single function app, there may be several cases when a single function app has to host (for example) a dozen of functions.

I suppose I'll have a look at parallel-webpack plugin as soon as I'll have some time, and share the results with you. This way we may build more or less a roadmap, with several more useful features (would be really cool) and let the magic happen 👍

fulls1z3 commented 6 years ago

@amrfarid140 meanwhile, please feel free to share any ideas as they come by, as well as pull requests (they're really very welcome) 😄