BigSamu / OpenSearch_Changelog_Workflow

A reusable workflow for automating changelog and release notes generation processes for OpenSearch repos
Apache License 2.0
0 stars 5 forks source link

Thoughts on using a bundler? #39

Open BSFishy opened 9 months ago

BSFishy commented 9 months ago

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 9 months ago

Makes total sense, Matt. I will work on this to implement the feature! Thanks for the suggestion.

BigSamu commented 7 months ago

@BSFishy,

I want to come back with this recommendation. Do you have any recommendations for a bundler to use? What do you think about webpack? What do you use - you guys - in OUI and OSD?

ashwin-pc commented 7 months ago

You can also use https://www.npmjs.com/package/@vercel/ncc

BigSamu commented 7 months ago

Oh yeah. I did try @vercel/ncc before. That one is a good choice. Thanks, Ashwin! I will try that!

msheldon32 commented 5 months ago

Sorry if this is a dumb question -

Do you want just the node_modules packed into a single file, or should I bundle everything in the application?

BigSamu commented 2 months ago

Check what @BSFishy mentioned at the beggining. The idea is to bundle the application entirely in a single file and don't worry about submit the _nodemodules folder.