Repository navigation
fix: order to pdf logo print #1132
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,8 +120,14 @@ module.exports = { | |
| test: /\.(woff|woff2|eot|ttf|otf)$/i, | ||
| type: "asset/resource" | ||
| }, | ||
| { | ||
| // inline the invoice logo so react-pdf never fetches it (CDN may serve WebP, react-pdf caches failures) | ||
| test: /fn-invoice-header\.png$/, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, fine as is since the ticket allows it: the filename regex is repeated in the inline rule and in the exclude, so renaming the asset quietly falls back to file-loader. An |
||
| type: "asset/inline" | ||
| }, | ||
| { | ||
| test: /\.jpg|\.png|\.gif$/, | ||
| exclude: /fn-invoice-header\.png$/, | ||
| use: "file-loader?name=images/[name].[ext]" | ||
| }, | ||
| { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mocks the logo import as a data URI, so the assertion still passes if the webpack rule is removed. I reverted
webpack.common.jsto master and all three invoice tests stayed green. It does catch the action passing a URL directly, but it doesn't guard the actual fix. Should we add a small check that fails when the inline rule stops applying? For example, compile the logo import and assert a PNG data URI comes out with no emitted image file. Otherwise a future edit to the rule brings the bug back with CI green.Side note: because
moduleNameMappersends every.pngtofileMock.js, thisjest.mockmakes every image import in this test file return the logo string, not just the logo.