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
I work in a mono repo which has a similar setup to this:
@repo/root
@my-company/my-awesome-package (public)
dependency: @repo/my-helper-package
@repo/my-helper-package (private)
I want to bundle and publish @my-company/my-awesome-package.
How it currently works
If I bundle with tsup it will not bundle @repo/my-helper-package in my output and if that output then is pushed to a registry the package is broken.
Currently I have the following line in my tsup.config.ts => noExternal: [/^@repo.*/], which will include all packages which start with @repo into the bundle.
What I would like to do
It would be cool if tsup has a config setting called something like bundlePrivatePackages: boolean. If its false it works like it does now. If its true though tsup would go and inspect the package.json file of imported packages and check if the package has "private": true set, if so it would include it in the output bundle if not leave the import statement.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
I recently ran into this issue on one of my projects.
I fixed the issue by including my private package as a file-based dependency in package.json. For example, if my private package is located (from the root of the project) in ./packages/my_fun_package, I can add it as a dependency in package.json: "my_fun_package": "file:./packages/my_fun_package".
By doing that, the package is added in node_modules and comes along for the ride when I install using npm i or npm ci.
I also add the path to my tsconfig.json in compilerOptions:
This makes sure that when I import in my package (e.g. import { fun } from 'my_fun_package) I don't get any red squiggles. Not sure how well it will work with noExternal, but this functions correctly with my private packages attached to another project.
Context
I work in a mono repo which has a similar setup to this:
I want to bundle and publish
@my-company/my-awesome-package
.How it currently works
If I bundle with tsup it will not bundle
@repo/my-helper-package
in my output and if that output then is pushed to a registry the package is broken.Currently I have the following line in my
tsup.config.ts
=>noExternal: [/^@repo.*/],
which will include all packages which start with@repo
into the bundle.What I would like to do
It would be cool if tsup has a config setting called something like
bundlePrivatePackages: boolean
. If itsfalse
it works like it does now. If itstrue
though tsup would go and inspect the package.json file of imported packages and check if the package has"private": true
set, if so it would include it in the output bundle if not leave the import statement.Upvote & Fund
The text was updated successfully, but these errors were encountered: