Fix source maps relative file lookup for source javascript file.#35
Open
MaicoTimmerman wants to merge 1 commit intomegawac:masterfrom
Open
Fix source maps relative file lookup for source javascript file.#35MaicoTimmerman wants to merge 1 commit intomegawac:masterfrom
MaicoTimmerman wants to merge 1 commit intomegawac:masterfrom
Conversation
Author
|
@megawac Do you have the time to take a look at these changes? |
Owner
|
Yeah the version of grunt we're using is super old (like 6 years) and with its subdeps changing underneath it it likely caused the test cases to break. I'll take a look at this this afternoon however I'm a bit confused why this would cause issues for |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We are using the ant-design-vue package with source maps, which depends on this package. During compilation there seem to be some problems with the source maps as generated with the compiled source.
The error is as follows:
I took a look at the source map that is generated by the closure compiler, which currently looks like:
{ "version":3, "file":"", "lineCount":16, "mappings":"...omitted...", "sources":["MutationObserver.js"], "names":["...omitted..."] }From the source map spec I know that the
filefield should contain the name of the minified file, in this casemutationobserver.min.js, however it seems closure compiler does not fill that.The main problem here is that the
sourcesfield should point to the original source file, relative to the source map file. As I'm unfamiliar with closure compiler and didn't see options to change thesourcesto["../MutationObserver.js"], I've moved the minified file and the relevant source map to the same folder as the original javascript file. This seems a more future proof solution than manually adding the..to the path, as the source map will still be correct after a recompile.P.S. I was unable to run the full test suite on
master, it seemsgunit:mainis not able to run on my local machine. I didn't look into the cause of that, meaning it didn't run for my changes.