调试 Opalrb 时如何使用 Sourcemaps

How can I utilize Sourcemaps when debugging Opalrb

Opal 正在生成源地图。我可以在 chrome 中启用 JavaScript 源映射,设置它甚至在调试器中停止的断点。但是实际用处还是不大

  1. 我无法调查局部变量。即使我尝试在 chrome 的控制台中对其进行评估,它们都显示为 Nil。
  2. 我希望能够在 ruby 来源和生成的 Javascript 之间切换(这并不难理解)。

到目前为止,我最成功的方法是在生成的 Javascript 中搜索重要标识符,而根本不使用源映射。

欢迎任何提示。

Sourcemaps 现在可以使用 Opal Server 在 Opal 0.8.0 中使用

# config.ru
require 'bundler'
Bundler.require

#Opal::Processor.inline_operators_enabled = true
run Opal::Server.new { |s|

s.append_path 'public'
s.append_path 'src'

Opal.use_gem "vector2d"

Opal.paths.each { |p| s.append_path(p) }


#s.use_gem 'vector2d'

# s.debug = true
s.source_map = true

s.main = 'application'

s.index_path = 'index_opal.html.erb'

}