-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(webpack): include hash in asset filenames so they do not conflict #27159
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit df73778. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targets
Sent with 💌 from NxCloud. |
packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts
Outdated
Show resolved
Hide resolved
…#27159) Our assets are generated as flat assets in dist, which allows using assets from workspace libs. This prevents users from having different assets with the same filename (e.g. `foo/image.png` and `bar/image.png`). This will error out in the dev server with conflicting filenames. We cannot use `[path][name]` because of assets that are outside of the app folder (e.g. `../../libs/ui/src/assets/image.png`). Thus the best option is to include hash. Note: Also re-enabled the e2e tests for `react.test.ts` file since it is now using Playwright instead of Cypress. ## Current Behavior Assets with the same filename will error in dev-mode. ## Expected Behavior Assets with the same filename works. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #18272 (cherry picked from commit 0710fea)
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. |
Our assets are generated as flat assets in dist, which allows using assets from workspace libs. This prevents users from having different assets with the same filename (e.g.
foo/image.png
andbar/image.png
). This will error out in the dev server with conflicting filenames.We cannot use
[path][name]
because of assets that are outside of the app folder (e.g.../../libs/ui/src/assets/image.png
). Thus the best option is to include hash.Note: Also re-enabled the e2e tests for
react.test.ts
file since it is now using Playwright instead of Cypress.Current Behavior
Assets with the same filename will error in dev-mode.
Expected Behavior
Assets with the same filename works.
Related Issue(s)
Fixes #18272