0

Can you explain, or point to good resource on how to setup a minifier (preferably google closure) to work with Google App Engine.

I use AngularJS for client side. So have bunch of JS files, and like to serve it as one, minified during production. Without manually editing index.html for which files to server, and not having trouble with GAE setup, how can I achieve this?

thanks.

bsr
  • 57,282
  • 86
  • 216
  • 316
  • why not do it in post deploy script instead? – Shay Erlichmen Oct 11 '12 at 20:13
  • @Shay, I am in development of my first GAE app. Not sure all the options available. If you can brief a bit about the approach as answer, that would be great. – bsr Oct 11 '12 at 20:18
  • 3
    Are you familiair with yeoman: http://briantford.com/blog/angular-yeoman.html – voscausa Oct 11 '12 at 20:33
  • Basically it got nothing todo with GAE directly, you use a deploy script that will upload the app but before it deploy it scans the app folder and run the minifer tool of your choice on any js file. – Shay Erlichmen Oct 11 '12 at 20:39
  • if you want to load some of the template via Jinja you could use Webassets with an angular bundle look at the YAMLLoader for webassets – BillPull Jan 21 '13 at 04:09

2 Answers2

1

You can let App Engine do the optimization work for you, thanks to the Page Speed service, which you can enable from the admin console settings page:

https://developers.google.com/appengine/docs/adminconsole/performancesettings#pagespeed

Fred Sauer
  • 1,012
  • 9
  • 20
0

modernizr has an ant build script that searches your html files for js and css, minifies and concatenates etc, etc creating a published version of your code. You will probably want to tweak it to ensure that things like jquery and angularjs get put in the right place. I hadn't used ant for awhile and it was pretty comprehensible. I imagine you could replace whatever js minifier is there with something like closure.

Just as an aside, make sure that you use $inject dependency injection so the minifier doesn't mess up your angular code.

hope this helps

--dan

Dan Doyon
  • 6,710
  • 2
  • 31
  • 40