本文介绍了如何在Lighttable中创建基本的ClojureScript Hello World应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LightTable中的文档似乎很少。我想在LightTable中创建一个非常简单的ClojureScript Web应用程序,以此作为构建的起点。我在Clojure的Instarepl工作正常,然后创建了一个包含以下内容的名为dummy.cljs的新文件:

The documentation seems quite sparse in LightTable. I want to create a very bare bones ClojureScript web application in LightTable as a starting point to build on. I have the Instarepl in Clojure working fine, and then I create a new file called dummy.cljs containing the following:

(ns dummy)

(js/alert "Hello lighttable")

如何我运行了这个吗?

我现在已经知道了,我将发布一段有关如何运行的视频。做到这一点,因为它很直观。

I have figured this out now, and I will post a video on how todo it as it is quite visual.

以下是视频:

推荐答案


  1. 您首先应该通过lein(),如

  2. 然后将cljsbuild添加到您的项目中,如

  3. 从终端运行(或在获胜时使用cmd)同时运行 lein环形服务器 lein cljsbuild auto ,以便使用clojurescript autocompile运行本地网络服务器

  4. connect LightTable(via底部的控制台)到您在步骤1中创建的项目

  5. 现在您可以编辑clojure和LightTable中的cljs和更改应交付给您的浏览器。但是不要忘了检查终端是否有错误,因为它们可能不会在LT中显示。

  1. you should first create a project via lein( https://github.com/technomancy/leiningen) as described here
  2. then add cljsbuild to your project, as described here
  3. run from terminal(or cmd on win) simultaneously lein ring server and lein cljsbuild auto, in order to run local web-server with clojurescript autocompile
  4. connect LightTable(via console at the bottom) to the project you've created in step 1
  5. now you can edit clojure and cljs in LightTable and changes should be delivered to your browser. But don't forget to check terminal for errors, as they probably won't be shown in LT.

使用简单的方法和lein repl作为主要开发工具,而LT仅用作解决一些小问题的附加工具一两个文件中出现问题。

Simpler way would be using http://clojurescriptone.com/ and lein repl as main development tool and use LT only as additional tool for solving some small problems within one-two files.

这篇关于如何在Lighttable中创建基本的ClojureScript Hello World应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 23:21