2

I would like to request /js/app.js from HarpJS server and have it preprocess a folder of coffeescript and javascript. For example, say I have:

/js/module/a.js
/js/module/b.coffee
/js/module/c.coffee
/js/app.coffee

Is there a way to request /js/app.js such that the response contains the concatenation of /js/module/a.js, of /js/module/b.js. and /js/module/c.js responses?

thesmart
  • 2,993
  • 2
  • 31
  • 34
  • Also this is an [open issue](https://github.com/sintaxi/harp/issues/127) on the Harp repo. – Evan Davis May 13 '15 at 23:28
  • 1
    @Mathletics Your quip about Google searching is pretty rude. The snippet you provide would concatenate on startup, which is not what I want. In my question, had you read it, I specify that I want the server to respond to a request with the concatenated result. – thesmart May 14 '15 at 00:39
  • I didn't mean to be rude; I wanted to clarify what, if anything, you've tried to solve the problem yourself. I don't see anything in your question indicating that a static concatenation _would not_ solve your problem. – Evan Davis May 14 '15 at 14:20
  • @Mathletics About 20% of the question is dedicated to describing ```Is there a way to request /js/app.js such that the response contains the concatenation of /js/module/a.js, of /js/module/b.js. and /js/module/c.js responses?``` Unfortunately, the solution you posted and then deleted would not solve that because every request would be the same set of scripts. I'm attempting to use Harp for development purposes, so dynamic script compilation upon every request is a requirement. – thesmart May 14 '15 at 15:22
  • I'd never heard of harp before this question; don't get mad at me for trying to help. In any case, looks like you're SOL as this exact issue has been open in their repo since Oct '13. – Evan Davis May 14 '15 at 15:34

1 Answers1

0

I ended up customizing the terraform module, writing a preprocessor called man.

Here is the diff from Harp: https://github.com/sintaxi/terraform/compare/master...thesmart:master

thesmart
  • 2,993
  • 2
  • 31
  • 34