You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a serverless setup with type: "module" and no bundler like vite, webpack etc (I use serverless-jetpack to upload only necessary files). With the actual output config of vite the lib is cjs only and cannot be imported like said in the doc under my configuration.
Because of that I have no choice but to import with default export
For example import awsPkg from "@h4ad/serverless-adapter/lib/adapters/aws/index.js";
It's not very convenient.
Describe the solution you'd like
It would be great if the lib was exported as both cjs and esm with appropriate resolution in package.json. It shoudn't impact cjs users and benefit to esm users
Are you willing to resolve this issue by submitting a Pull Request?
I can try to do it but I prefer to wait some comments on this request if I missed something
The text was updated successfully, but these errors were encountered:
Having the path as import awsPkg from "@h4ad/serverless-adapter/lib/adapters/aws/index.js" is intentional because I want the CJS users to have multiple environments supported in the same code and they only need to install a library for that environment if they import that file.
But if we can have something like: import awsPkg from "@h4ad/serverless-adapter/adapters/aws I will be happy to accept.
I don't know much about publishing to esm, so I appreciate it if you could open a PR.
The main goal that we should achieve is: that the users can install this library and only need to install an optional dependency if they import that code, so express users can use ExpressFramework without need to install all the other frameworks, for example.
Feature Request
Is your feature request related to a problem? Please describe.
I have a serverless setup with type: "module" and no bundler like vite, webpack etc (I use serverless-jetpack to upload only necessary files). With the actual output config of vite the lib is cjs only and cannot be imported like said in the doc under my configuration.
Because of that I have no choice but to import with default export
For example
import awsPkg from "@h4ad/serverless-adapter/lib/adapters/aws/index.js";
It's not very convenient.
Describe the solution you'd like
It would be great if the lib was exported as both cjs and esm with appropriate resolution in package.json. It shoudn't impact cjs users and benefit to esm users
Are you willing to resolve this issue by submitting a Pull Request?
I can try to do it but I prefer to wait some comments on this request if I missed something
The text was updated successfully, but these errors were encountered: