Clojure China

Run Lumo with `node --inspect`

#1

Context here https://twitter.com/anmonteiro90/status/851312033601437697

My purpose was to run Lumo directly with Node.js , then people like me who is more familiar with Node.js can use node --inspect to use DevTools to find slow functions.

According to @anmonteiro90 that usage of Lumo is already supported. The thing to do is to compile with boot dev, which looks like:

(deftask dev []
  (comp
    (check-node-modules)
    (watch)
    (speak)
    (compile-cljs)
    (sift-cljs-resources)
    (cache-edn->transit)
    (write-core-analysis-caches)
    (target)
    (bundle-js :dev true)))

Make sure you have run yarn to get the latest dependencies. Then yarn dev will be okay, which is an alias for:

node target/bundle.js -k lumo-cache -c target

-k refers “cache”, -c refers to “classpath”. So for my case, I can run with this command:

node --inspect target/bundle.js

It will generate an URL for Chrome to open the DevTools. to start with the most simple commands.

I tried, the Profiler in DevTools worked. Cheers.

1赞
于关闭 #2

本主题在创建 100 天后自动关闭。不再允许添加新回复。