-
-
Notifications
You must be signed in to change notification settings - Fork 108
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: add option to keep source maps #216
feat: add option to keep source maps #216
Conversation
README.md
Outdated
@@ -289,7 +289,7 @@ module.exports = { | |||
|
|||
### `deleteOriginalAssets` | |||
|
|||
Type: `Boolean` | |||
Type: `Boolean|keep-source-map` |
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.
Boolean | 'keep-source-map'
const updatedAssetInfo = { | ||
...info, | ||
related: { ...info.related, sourceMap: null }, | ||
}; |
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.
Let's do it better:
delete updatedAssetInfo.related.sourceMap;
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.
I tried this, this is not working. The sourceMap is getting added back if a value is not provided.
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.
Webpack I think is doing a smart merge there. 🤔
393, | ||
], | ||
Array [ | ||
"async.async.1c2911c7c819fc826fb7.js", |
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.
hm, I think we should have source map here
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.
Source map was not generated for that.
[
'09a1a1112c577c2794359715edfcb5ac.png',
'23fc1d3ac606d117e05a140e0de79806.svg',
'main.6a5afd3ff5b2f0fa8aaa.js',
'async.async.1c2911c7c819fc826fb7.js',
'main.6a5afd3ff5b2f0fa8aaa.js.map'
]
these are the total assets included for compression.
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
==========================================
+ Coverage 98.18% 98.21% +0.03%
==========================================
Files 4 4
Lines 165 168 +3
Branches 48 49 +1
==========================================
+ Hits 162 165 +3
Misses 2 2
Partials 1 1
Continue to review full report at Codecov.
|
I am not sure why tests are failing. I tested with both webpack 4 and 5 in local everything works fine 🤔 |
Ah, Found it. latest version |
All is fine |
This PR contains a:
Motivation / Use-Case
Fixes #215 . Added option to not delete sourcemap when deleting the originalAsset
Breaking Changes
none
Additional Info
none