Skip to content

you did replicate something existing. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
frank-dspeed opened this issue Mar 18, 2022 · 0 comments
Open

you did replicate something existing. #2

frank-dspeed opened this issue Mar 18, 2022 · 0 comments

Comments

@frank-dspeed
Copy link

https://www.npmjs.com/package/@vercel/ncc

is pritty capable of solving your cjs versions generation on a project base you will never want to publish the CJS dependencies you should adopt the following pattern.

you create so called dev bundels of your dependencies so your dependencies get a own package.json and bundler config then you run that only when you add or remove external dependencies to your project.

then you use the resulting bundle in your main project. and also commit that to the main project as it is a required dependencie

this is called a dev-bundle.

Short version

You should avoid publishing your own CJS dependencies as packages. you should bundle them and commit that bundle to your main project and create a indipendent package or project to build only your external dependencies as CJS modules.

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

No branches or pull requests

1 participant