Sourcemaps are detected in chrome but original source is not loaded, using webpack-2

前端 未结 3 1356
Happy的楠姐
Happy的楠姐 2020-12-11 00:05

When running an application that is built using webpack 2, sourcemaps are detected in chrome but original source is not loaded. I\'m using webpack beta21.

These file

3条回答
  •  既然无缘
    2020-12-11 00:29

    Generated files with source maps won't automatically redirect to their original files, because there's potentially a 1-to-many relationship.

    If you see the message Source Map Detected, the original file should already appear on the side file tree or the file explorer via Crl + P. If you don't know the original file name, you can open the source map file itself.

    1. The source map path can be identified by a //# sourceMappingURL= comment or the X-SourceMap header:

    2. Open up the source map via url and look for the sources property for the original file name:

    3. The original file should be visible in the sources panel:

    If you don't see the message Source Map Detected

    You can manually add an external source map by right clicking and selecting Add Source Map:

    Additional Resources

    • If that still doesn't work, you can try a Source Map Validator
    • For webpack specifically, you can configure the devtool property

提交回复
热议问题