私は2つのファイルを持っています。 ./main.coffee
および./shared.coffee
。私は両方をコンパイルするためにmakefileを使用して、./main.js
にconcatinateしたいと思います。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
このメソッドをcatと組み合わせてファイルをマージするにはどうしたらいいですか? coffee --joinを使用して
[coffee - join](http://jashkenas.github.com/coffee-script/#usage)を参照してください。 –