Skip to content
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

feat(bundling): add support only bundling in workspace libs, not npm packages #12852

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Oct 27, 2022

This PR allows users to pass the --no-third-party option (or --third-party=no), so the generated bundled will include all workspace libs but exclude third-party packages.

Why?

This is useful for Docker images, publishing to npm, etc. where you expect third-party packages to be installed via npm i (or yarn or pnpm i).

Alternatives

The workaround currently is to pass a fixed --external list (e.g. --external=rambda,dayjs,chalk,uuid), which will exclude those packages in the bundle. The --no-third-party option will automatically mark these as external, and include them in the generated package.json file.

Current Behavior

Bundle includes everything -- unless in --external list.

Expected Behavior

Bundle only includes libs/packages in the workspace.

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented Oct 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Oct 28, 2022 at 2:19PM (UTC)

@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 27c1e84 to 8aba148 Compare October 27, 2022 15:36
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 8aba148 to c250753 Compare October 27, 2022 17:40
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from c250753 to 54444ea Compare October 27, 2022 19:46
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 54444ea to 52fd6d8 Compare October 28, 2022 01:26
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 52fd6d8 to 8b17314 Compare October 28, 2022 01:33
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 8b17314 to 2ecdb82 Compare October 28, 2022 01:46
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 2ecdb82 to a1e3c57 Compare October 28, 2022 01:53
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from a1e3c57 to c082c98 Compare October 28, 2022 02:17
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from c082c98 to bf302d6 Compare October 28, 2022 03:22
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from bf302d6 to 21eb61d Compare October 28, 2022 12:25
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from 21eb61d to a4f50a7 Compare October 28, 2022 12:42
@jaysoo jaysoo force-pushed the feat/esbuild-bundle-workspace-libs branch from a4f50a7 to fbf5a45 Compare October 28, 2022 13:30
@jaysoo jaysoo requested a review from nartc October 28, 2022 14:41
@jaysoo jaysoo merged commit 58b5196 into nrwl:master Oct 31, 2022
@jaysoo jaysoo deleted the feat/esbuild-bundle-workspace-libs branch October 31, 2022 13:05
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants