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
Update sourcemapPathTransform to also take the path to the sourcemap … #3617
Conversation
generateError: { | ||
code: 'VALIDATION_ERROR', | ||
message: 'sourcemapPathTransform function must return a string.' | ||
} |
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 section is wrong but I didn't find a way to assert about the sourcemap output or even just the js output... pointers here would be helpful.
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.
Why don't you just extend this one to use the new parameter: https://github.com/rollup/rollup/tree/master/test/sourcemaps/samples/transform-source-paths ? Alternatively, you can put a modified one next to it.
docs/999-big-list-of-options.md
Outdated
@@ -670,7 +670,7 @@ The location of the generated bundle. If this is an absolute path, all the `sour | |||
`sourcemapFile` is not required if `output` is specified, in which case an output filename will be inferred by adding ".map" to the output filename for the bundle. | |||
|
|||
#### output.sourcemapPathTransform | |||
Type: `(sourcePath: string) => string` | |||
Type: `(sourcePath: string, sourcemapPath: string) => string` | |||
|
|||
A transformation to apply to each path in a sourcemap. For instance the following will change all paths to be relative to the `src` directory. |
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 believe a short explanation of what sourcePath
is as opposed to sourcemapPath
here would help avoid a lot of confusion.
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.
Looks sensible to me, see my two comments regarding fixing the test and slightly extending documentation.
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.
As I will be on vacation shortly I performed my suggested changes myself and fixed the types, I hope you do not mind.
Codecov Report
@@ Coverage Diff @@
## master #3617 +/- ##
=======================================
Coverage 96.48% 96.48%
=======================================
Files 182 182
Lines 6236 6236
Branches 1830 1830
=======================================
Hits 6017 6017
Misses 108 108
Partials 111 111
Continue to review full report at Codecov.
|
No I don't mind. I was planning on following up tomorrow but I'm happy to
not need to do that. I'll still glance over your changes to get an idea of
what I can do better for any future PRs.
…On Sun, Jun 7, 2020, 9:53 PM Lukas Taegert-Atkinson < ***@***.***> wrote:
Merged #3617 <#3617> into master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3617 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIGO54VN5YT2PE3BD36QG3RVRVC3ANCNFSM4NTKIJLQ>
.
|
…file as a second argument
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: #3615
Description
This aims to solve the problem in #3615. I need some help figuring out the best way to write the test for this. I manually tested by making the same change to rollup in my project and verified I could generate sourcemaps correctly by utilizing this change.