fix: delay remove of intermediate debugging assets to afterEmit#251
fix: delay remove of intermediate debugging assets to afterEmit#251upupming wants to merge 2 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 0d965bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
colinaaa
left a comment
There was a problem hiding this comment.
I don't believe this is the ideal way to resolve the issue. If you would like to consume the source-map in other plugin, maybe try to read source map from memory instead of expecting it to be generated on disk.
| files2Delete.push(asset + '.map'); | ||
| } | ||
| for (const file of files2Delete) { | ||
| fs.rmSync( |
There was a problem hiding this comment.
Emitting the asset to disk first and then manually deleting it seems inefficient.
<!-- Thank you for submitting a pull request! We appreciate the time and effort you have invested in making these changes. Please ensure that you provide enough information to allow others to review your pull request. Upon submission, your pull request will be automatically assigned with reviewers. If you want to learn more about contributing to this project, please visit: https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md. --> ## Summary <!-- Can you explain the reasoning behind implementing this change? What problem or issue does this pull request resolve? --> This patch resolves a regression from issue #231 that prevented obtaining the correct content hash for `background.js`. The fix involves delaying the `processAssets` stage of Encode to `PROCESS_ASSETS_STAGE_OPTIMIZE_HASH`. The removal of debugging assets is postponed to `compiler.hooks.afterEmit` to ensure accurate retrieval of assets and their corresponding source maps. close: #251 <!-- It would be helpful if you could provide any relevant context, such as GitHub issues or related discussions. --> ## Checklist <!--- Check and mark with an "x" --> - [x] Tests updated (or not required). - [ ] Documentation updated (or **not required**).

Summary
Checklist