danvk / source-map-explorer

Analyze and debug space usage through source maps
Apache License 2.0
3.82k stars 100 forks source link

Add option to prevent "Your source map only contains one source" #93

Closed Knagis closed 5 years ago

Knagis commented 5 years ago

https://github.com/danvk/source-map-explorer/issues/10

I am generating source maps in batch for every bundle in my project. Some bundles do have only one source (for example, some third party lib). I would like to output these bundles the exact same format as any other so that whoever reviews the maps can see full information.

Thus it would be useful to have a option to override this error and have it output the map, even though it is "uninteresting".

Knagis commented 5 years ago

It would also need to leave the filename intact when noroot is used (otherwise the common prefix is the whole path)

nikolay-borzov commented 5 years ago

It would also need to leave the filename intact when noroot is used (otherwise the common prefix is the whole path)

Could you provide an example? I don't really understand the issue

eXaminator commented 5 years ago

I have a similar problem.

We use react-intl in our project and dynamically load locale data. Create-react-app (webpack) splits the bundle up based on that. Those locale files are single files and each file becomes its own minified module in my build directory.

So the source maps contain only a single source:

"sources":["../node_modules/react-intl/locale-data/ka.js"]

Currently source-map-explorer seems to ignore these files, but it would be nice to allow to include them, if only for the correct total size of the "combined module".