Skip to content

-> 0.5: Only create sourcemaps for concatenation, add tests, etc#8

Open
Rich-Harris wants to merge 6 commits into
masterfrom
0.5
Open

-> 0.5: Only create sourcemaps for concatenation, add tests, etc#8
Rich-Harris wants to merge 6 commits into
masterfrom
0.5

Conversation

@Rich-Harris

Copy link
Copy Markdown
Contributor

@IvanSanchez I started looking into Rich-Harris/sorcery#68 and ended up in a bit of a rabbit hole – bear with me:

AFAICT, as of #1 gobble-concat processes the sourcemaps of its sources – is that right? When I tried to build Leaflet.VectorGrid, it fell apart because one of the sources had an inline data URI for the sourceMappingURL, which wasn't expected.

Anyway, processing incoming sourcemaps is a bit unusual – in theory a transformer should only worry about creating a sourcemap for its own transformation, and let Gobble flatten everything as a final step. To that end, this PR reverts 1aaa1f6 and generates fresh sourcemaps for all .js and .css files (unless options.sourceMap === false), ignoring existing sourcemaps other than to remove the sourceMappingURL comments.

It does a couple of other things besides (I should have been a bit more disciplined and done this as several PRs, but like I said, rabbit hole...) – it adds some tests and a build process.

What do you reckon?

@Rich-Harris

Copy link
Copy Markdown
Contributor Author

Ha, I've just seen all the other open PRs. D'oh, sorry. Will take another look at all this in the morning...

@IvanSanchez

IvanSanchez commented Apr 27, 2016

Copy link
Copy Markdown
Member

@Rich-Harris Yeah, please have a look at #6 and #7. I've had similar problems with inlined base64 sourcemaps.

in theory a transformer should only worry about creating a sourcemap for its own transformation, and let Gobble flatten everything as a final step.

Yeah, in theory. :-( :-(

In practice, I run into problems with unresolved file paths which are symlinks, which has led me to create rollup/rollup#627 and gobblejs/gobble-unpackage@4c675fa. Unfortunately I have found that it's way more reliable if gobble transformers handle sourcemaps properly by themselves.

Please do try out #7, let me know what you think. Oh, and sandermatch too, gobble plugins use the same repeated sander+minimatch pattern way too often.

@msegado

msegado commented Mar 2, 2017

Copy link
Copy Markdown

Any chance #7 or similar could be merged sometime? Just ran into Rich-Harris/sorcery#68, tried upgrading to gobble-concat ^0.4 to fix it, and ran into the data-UR-sourcemap issue instead 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants