-
Notifications
You must be signed in to change notification settings - Fork 9
Support source maps with no file existing on disk #3
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
Comments
Okay @rjgotten I think we can accomodate. You have some well structured points so I will just reply.
I think you are on the right track. Trying to infer how the source-map sources are constructed really requires project knowledge. Originally I went for the general solution but it is only reliable if we check the files exist.
Where a file check is necessary I think it makes sense to restrict it to the codec. I would need to survey myself. 🤔 This would probably be the best "separation of concerns" but maybe a risky change without tests. I would need to look properly. Failing that I could add a flag that allows you to opt-out of the tests. There is precedent with the abstract flag. So maybe a Let me know what your preference is. |
Maybe something slightly more intelligent: skip only the verification of whether files exist on disk, provided the source map already has the file content embedded as a Ofcourse, a |
@rjgotten your suggestion is interesting but I suspect unsuitable - It is not always possible to opt-out of Fundamentally I think that most of the codecs only work if the files are present. Otherwise there is no basis to differentiate them. I think we can remove the additional check you originally highlighted. I am thinking it was probably originally done to validate the output of custom codecs. But as you have found it is over-restrictive. I am inclined to just remove it as a breaking change and publish a |
@rjgotten looking at the code just now I recall the concept of an This is usually used for sources such as the webpack bootstrap that can be recognised but will not be amended in any way. If you don't intend to amend the However if you intend to adjust these |
@rjgotten please try |
@rjgotten should we release this? how did it go? |
I have not yet been able to revisit the part of the project in question, where I needed to apply this. |
No rush @rjgotten. Let me know when you do. |
I'm going to release this on risk @rjgotten 🤞 |
Should be fixed by #6 🤞 |
Source map destination files do not need to exist on disk. Source text can be embedded within the map file instead.
Current codecs all check for validity of a file on disk.
While it's possible to create 'unchecked' variants of these, later on inside the loader's own processing we arrive at another file check:
adjust-sourcemap-loader/lib/process/decode-sources-with.js
Lines 51 to 54 in b2c8bf2
This we cannot resolve from user-land. It basically makes the entire loader useless if you're dealing with libraries that use embedded source maps.
The text was updated successfully, but these errors were encountered: