我有2個文件。 ./main.coffee
和./shared.coffee
。我想使用makefile來編譯,然後將其分解爲./main.js
。使用makefile從coffeescript編譯後合併javascript文件
這是我目前有:
public: main.min.js
main.min.js: main.js
uglifyjs ./main.js > ./main.min.js
#combine the shared files with the compiled main.coffee
main.js: ./main.coffee
coffee -c ./main.coffee #problem1
cat ./main.js ./shared.js > ./main.js
shared: ./shared.coffee
coffee -c ./shared.coffee
我知道這會給出錯誤的cat
操作。如何編譯並將標記爲problem1
的行內容傳遞給cat方法,而不從其生成main.js。
例如, coffeescript網站給了這個:Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT. Good for use with processes written in other languages. An example: cat src/cake.coffee | coffee -sc
我該如何將這種方法與貓合併文件?
查看[coffee --join](http://jashkenas.github.com/coffee-script/#usage)。 – 2012-03-11 22:09:54