danvk / source-map-explorer

Analyze and debug space usage through source maps
Apache License 2.0
3.83k stars 101 forks source link

Support Webpack's hidden-source-map #124

Closed benmccann closed 5 years ago

benmccann commented 5 years ago

Is your feature request related to a problem? Please describe. source-map-explorer works with Webpack 4 when devtool: 'source-map', but not when devtool: 'hidden-source-map'

Describe the solution you'd like Look for a file that has the same name as the given file, but with .map. So if I run source-map-explorer myproject.bundle.js then look for source-map-explorer myproject.bundle.js.map or let me run source-map-explorer myproject.bundle.js.map

Describe alternatives you've considered I temporarily change hidden-source-map to source-map in my webpack config and rebuild, but it's an extra step to do each time I want to run the tool

Additional context devtool docs explain that when hidden-source-map is set then source maps are generated but not linked

nikolay-borzov commented 5 years ago

You can use glob to match map file as well

source-map-explorer myproject.bundle.js?(.map)
benmccann commented 5 years ago

Cool. That worked. Or even source-map-explorer myproject.bundle.js* for less typing

Thanks! I'll leave this open in case you think it's worth documenting, but feel free to close. I appreciate your help!

nikolay-borzov commented 5 years ago

Updated readme mentioning glob patterns support