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 nxCopyAssetsPlugin for Vite to use in JS libs #27593

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Aug 22, 2024

This PR adds a nxCopyAssetsPlugin for Vite to brings it to parity with the other compilers/bundlers (tsc, swc, esbuild, rollup, and webpack).

When generate a lib with Vite (e.g.nx g @nx/js:lib --bundler=vite or nx g @nx/react:lib --bundler=vite), we expect it to at least copy README.md as an asset.

Note: Vite has support for copying assets from public/ but that is less flexible and more intended for apps, not libs.

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #27351

@jaysoo jaysoo requested review from a team as code owners August 22, 2024 16:42
@jaysoo jaysoo requested a review from Coly010 August 22, 2024 16:42
Copy link

vercel bot commented Aug 22, 2024

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Aug 22, 2024 5:01pm

@jaysoo jaysoo merged commit ca9f3cc into master Aug 22, 2024
6 checks passed
@jaysoo jaysoo deleted the feat/vite-assets-plugin branch August 22, 2024 17:30
Copy link

github-actions bot commented Sep 2, 2024

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 Sep 2, 2024
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.

The built library does not include assets correctly in nx project?
4 participants