BigSamu / Dev-Bot

MIT License
1 stars 2 forks source link

Thoughts on using a bundler? #8

Open JohnathonBowers opened 10 months ago

JohnathonBowers commented 10 months ago

From Matt:

"I feel like I mentioned at some point to add the node_modules directory to the .gitignore, which I think the consensus was that it breaks the running because those dependencies don't exist at runtime. Looking at some actions that I've authored myself, I realized I used a bundler to make sure I didn't include the node_modules directory.

I feel like including the node_modules directory is unnecessary and a little bit of a bad practice, as it can get out of sync with the package.json and package-lock.json, and makes clones and usages of the repo larger.

Have you considered employing a bundler to bundle everything together into a single file so that you don't need to worry about including the node_modules file? Of course, this would mean with each change you would need to re-bundle, but it's possible that could be automated with a precommit hook that bundles and adds the file to the commit so that there's no additional work necessary.

Just curious if it's something you've considered and thoughts around it :)"

BigSamu commented 10 months ago

@BSFishy,

In our current main branch, we don't have anymore the node_modules folder (it was added in our .gitignore file). However, I like your idea of implementing a bundler. The current logic for our GitHub App (this repo) is deployed in Vercel, but in the following weeks, we are going to deploy using an AWS Lambda (talking with the OpenSearch infra team).

Do you have any suggestions for implementing this bundler? What tool do you recommend for the bundler itself? For sure, I will use a precommit hook to automate the build when updating any code.