使用源映射调试 openlayers 5 应用程序

Debugging openlayers 5 application, using source map

我正在从 openlayers 2 迁移到 5。我已经下载了 distribution 带有缩小的 js 和源地图。然后我在 index.html:

中包含了 js 文件
<script src="bower_components/openlayers/ol.js"></script>

现在我想调试源代码。当我进入 ol.js 时,有 'Source Map detected' 消息。问题是我在 chrome 源映射文件的开发控制台源中看不到:

现在我使用 ol-debug.js 进行调试。也许 source map 是更好的调试方式,但仍然无法使其工作。我关注了https://github.com/openlayers/openlayers/issues/8330。它仅适用于 linux/mac。所以要编译ol-debug.js(应该安装npm):

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

然后按照 github 问题中的步骤进行操作。