Skip to content

Conversation

@jpvanhal
Copy link
Contributor

@jpvanhal jpvanhal commented Jan 5, 2016

Path information was lost from the source map due to path.basename() being run for each file in the source map. I'm not sure why this piece of code was there, but everything seems to be working fine after removing it.

Here's how the source map generated by npm run test-source-map looks now in Chrome developer tools:

Before:
nayttokuva 2016-01-05 kello 14 16 25

After:
nayttokuva 2016-01-05 kello 14 16 20

@jhnns
Copy link
Member

jhnns commented Mar 23, 2016

Awesome! I'll check this PR and merge it asap.
Sorry for the delay 😞

@jhnns jhnns merged commit 5c0bbe4 into webpack:master Mar 24, 2016
@jhnns
Copy link
Member

jhnns commented Mar 24, 2016

Looks good, thanks 👍

@jhnns
Copy link
Member

jhnns commented Mar 25, 2016

Has been published with 2.2.3

@gartz
Copy link

gartz commented Mar 26, 2016

thanks 👍

@jpvanhal jpvanhal deleted the fix-source-map-missing-paths branch March 26, 2016 07:43
@makuko
Copy link

makuko commented Aug 9, 2016

Unfortunately removing this code breaks paths when using the style-loader. Or at least the ones that were working before (only the resource itself, not @imported). How about instead of using path.basename() we use path.relative(loaderContext.context, file). That way paths are fine when style-loader is used. npm run test-source-map looks almost the same as without any rewriting. The only difference is that instead of ./test it will be /test.

@jpvanhal @jhnns What do you think?

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.

4 participants