1

I am trying to write a script to compress my js files into one file for my ember app.

I have been using Yui Compressor which works fine with my js files. I am having trouble finding a compressor for my handlebars templates. Does anyone know of one? Here is my script so far:

#!/bin/bash
rm application.js
touch application.js


java -jar yuicom.jar js/libs/jquery-1.9.1.js >> application.js
java -jar yuicom.jar js/libs/handlebars-1.0.0-rc.3.js >> application.js

cat js/libs/emb-latest-min.js >>  application.js

java -jar yuicom.jar js/*.js >> application.js
java -jar yuicom.jar js/templates/*.hbs >> application.js

Is there a better way to compile an ember app? Ive been using Rails where they do it for you, but now I want to use ember for a php site.

Alberto Zaccagni
  • 30,779
  • 11
  • 72
  • 106
Dan Baker
  • 1,757
  • 3
  • 21
  • 36
  • Maybe the question should be tagged with php? You want to compress your javascripts from php right? Or you want to call your actual script from php. – Lynch May 16 '13 at 23:00
  • Sorry that wasn't clear. I am trying to write a script that will precompile my js and handlebars files into one file. No server side logic I don't think – Dan Baker May 16 '13 at 23:41
  • Then I understand that you need to minify your handlebar templates. See if this can help: http://stackoverflow.com/questions/12376368/minify-html-files-in-text-html-templates – Lynch May 17 '13 at 00:53
  • 1
    If it's only needed for development, so that you can work with an `application.js` or `application.min.js` in production it is worth to see what `NodeJS` along with `Grunt` can do for you. See Treks project at GitHub to see the advantages of it: https://github.com/trek/ember-todos-with-build-tools-tests-and-other-modern-conveniences – herom May 17 '13 at 04:14

0 Answers0