machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

How to compile 0.5.0 to raw javascript #220

Closed trobrock closed 9 years ago

trobrock commented 9 years ago

Hey there we are trying to upgrade to 0.5.0 in our lineman-ember app and cannot use the amd version that builds, is there a way to compile this into something like what was previously compiled in 0.4.0?

mixonic commented 9 years ago

@trobrock you're going to need to actually explain how you are using Emblem. Are you compiling server-side or client-side? Are you using a library or compiling with custom code (and what does that code look like)?

May be addressed by https://github.com/machty/emblem.js/issues/212

trobrock commented 9 years ago

We are using lineman, which uses the grunt-emblem plugin to compile before we deploy the site.

trobrock commented 9 years ago

But my issue is with the emblem.js source we used to be able to get a emblem.min.js, now it seems we can only get an emblem.amd.js. Lineman in our current setup does not support amd style requires.

mixonic commented 9 years ago
  1. The grunt-emblem project requires Emblem 0.4.0. It states this on their Readme.
  2. 212 tracks the lack of a globals build.

Cool, so I'm going to close this as a duplicate. Let me know if I've missed anything!

trobrock commented 9 years ago

Ok thanks, so currently we are SOL on running 0.5.0 in our current environment then?

mixonic commented 9 years ago

Updating grunt-emblem, or putting together a new compiler, should not be difficult. Compiling a template in Node is very simple:

var emblem = require('emblem').default;
var hbsTemplateString = emblem.compile(someEmblemTemplateString);

Reading and writing the templates is pretty straight ahead. Then pass the HBS template through a regular build pipeline for Ember templates (whatever version you need).