Skip to content
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

Make source map files generated correctly. #51

Merged
merged 1 commit into from
Jul 8, 2016

Conversation

AlbertXingZhang
Copy link

@AlbertXingZhang AlbertXingZhang commented Jul 1, 2016

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

    Bug Fix

  • What is the current behavior? (You can also link to an open issue here)

    The generated source map file for main.bundle.js only contains the following incorrect content.

{"version":3,"sources":[],"names":[],"mappings":"","file":"initial.css","sourceRoot":""}

@nnixaa
Copy link
Collaborator

nnixaa commented Jul 7, 2016

Hi @AlbertXingZhang, could you provide a bit more details, I just pulled your changes locally and see no difference, could you point me out on what I'm missing?

@AlbertXingZhang
Copy link
Author

AlbertXingZhang commented Jul 7, 2016

Hi @nnixaa,

For example, in production environment the webpack produces main bundle javascript file (like main.d1226f060c4abdb58c79.bundle.js) with its source map file (like main.d1226f060c4abdb58c79.bundle.map). But the source map file is wrong. It has been overwritten by ExtractTextPlugin. In order to get correct source mappings for the javascript file, the trick is using [file] for sourceMapFilename config. You can find more detailed discussions at webpack-contrib/extract-text-webpack-plugin#119.

Here are the source map files generated before and after this patch.

@nnixaa nnixaa merged commit 1843d19 into akveo:master Jul 8, 2016
@nnixaa
Copy link
Collaborator

nnixaa commented Jul 8, 2016

Awesome, thanks @AlbertXingZhang

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