Skip to content

Conversation

tvhees
Copy link
Collaborator

@tvhees tvhees commented Aug 22, 2025

I'm not sure we'll need this but I think it's cleaner than expecting everything to be dumped in dist, especially when resolving the paths within a service.

Optionally we can also keep the /handlers/ folder but I don't see us bundling non-lambda code..

I've also moved the resolver functions below the service stack as that's the most important part of a service.

This will handle nested folders in a more predictable way when bundling and resolving paths
@tvhees tvhees changed the base branch from main to feat/MI-246-vite-bundle-lambda-code August 22, 2025 06:34
Copy link
Contributor

@kai-nguyen-aligent kai-nguyen-aligent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any change in term of logic around where the output is. However, I think this looks much cleaner than my original code.

@tvhees
Copy link
Collaborator Author

tvhees commented Aug 24, 2025

I don't see any change in term of logic around where the output is. However, I think this looks much cleaner than my original code.

Previously this

src/
    runtime/
         handlers/
              fetch-products.ts
              backend/
                  fetch-products.ts
              erp/
                  fetch-products.ts

would be built to

dist/
    fetch-products/
            index.mjs

with the most nested file winning, based on my limited testing

Now it will build to this:

dist/
    fetch-products/
        index.mjs
    backend/
        fetch-products/
            index.mjs
    erp/
        fetch-products/
            index.mjs

It's probably rare we'll have exactly the same file names, but being able to group handlers by folder is useful sometimes and I think this is a more predictable output structure.

@tvhees tvhees merged commit 2977608 into feat/MI-246-vite-bundle-lambda-code Aug 24, 2025
2 checks passed
@kai-nguyen-aligent
Copy link
Contributor

You're right. I forgot to check the nested folder cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants