Search code examples
openlayersopenlayers-5

how to get source map for examples in Chrome


Working with the ol 5 examples in Chrome when I open a source file in the dev tools I only see the compiled webpack version and I get the message "Source Map detected ..." but I'm at a loss as to how to open the associated .map file.

In my very limited experience with other webpack complied projects the source was displayed without any action on my part.


Solution

  • You need to open browser Dev Tools the, go to "Sources", on the right panel, you click on simple.js. It states "Source Map detected".

    Then, go into "webpack" directory and you should see the simple.js file unminified coming from the sourcemap. See image below where I've set a breakpoint to illustrate

    Sourcemap screenshot