How to insert a comment in the generated javascript file?

89 views
Skip to first unread message

Yehonathan Sharvit

unread,
Jul 30, 2014, 10:37:08 AM7/30/14
to clojur...@googlegroups.com

How to insert a comment in the generated javascript file?

1. In simple compilation mode
2. In advanced compilation mode


Daniel Kersten

unread,
Jul 30, 2014, 11:54:19 AM7/30/14
to clojur...@googlegroups.com
You could use :preamble to prepend a file to the generated output.




--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Yehonathan Sharvit

unread,
Aug 6, 2014, 6:56:26 AM8/6/14
to clojur...@googlegroups.com
I am not able to make it work. Where should I put the file? In the same folder as project.clj?


You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/Zc0bSoA5LA4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

Daniel Kersten

unread,
Aug 6, 2014, 7:35:58 AM8/6/14
to clojur...@googlegroups.com
I believe it needs to be on the classpath. For example, I put my js files in resources/assets (where resources is in the same directory as project.clj) and I use preamble like this:

:compiler {
  :preamble ["assets/js/myfile.js"]
  ; other compiler options

Yehonathan Sharvit

unread,
Aug 24, 2014, 4:44:08 AM8/24/14
to clojur...@googlegroups.com
It works now. Thanks.

But what is this “resources” folder?
Is it hard-coded in the cljs compiler? Where is it documented?

Daniel Kersten

unread,
Aug 24, 2014, 6:23:05 AM8/24/14
to clojur...@googlegroups.com
If you use `lein new` it should have been created for you. Its a directory that gets added to the classpath and is typically used for non-code resources and by default is "resources". You can change it (or add other directories to it) by setting :resource-paths in your project.clj:

Reply all
Reply to author
Forward
0 new messages