Search code examples
google-chromeopenlayerssource-mapsopenlayers-5

Debugging openlayers 5 application, using source map


I am migrating from openlayers 2 to 5. I have downloaded distribution with minified js and source maps. Then I included js file in index.html:

<script src="bower_components/openlayers/ol.js"></script>

Now I want to debug sources. When I am step into ol.js there is 'Source Map detected' message. The problem is I don`t see in chrome dev console sources from source map file:

enter image description here


Solution

  • For now I am using ol-debug.js for debugging. Perhaps source map is better way to debug, but still can`t make it work. I have followed https://github.com/openlayers/openlayers/issues/8330. It works only on linux/mac. So to compile ol-debug.js(npm should be installed):

    git clone https://github.com/openlayers/openlayers.git
    cd openlayers
    npm install
    npm install --global rollup
    

    Then follow steps in github issue.