Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call dust.optimizers.format with the full context #175

Closed
kilianc opened this issue Oct 15, 2012 · 2 comments
Closed

call dust.optimizers.format with the full context #175

kilianc opened this issue Oct 15, 2012 · 2 comments

Comments

@kilianc
Copy link
Contributor

kilianc commented Oct 15, 2012

This would allow something like this:

var env = process.env.NODE_ENV
var compressedByDefault = env === 'production'
var compressedFormat = dust.optimizers.format
var uncompressedFormat = function (ctx, node) { return node }

dust.optimizers.format = function (ctx, node) {
  var compressed = ctx.compressed === undefined ? compressedByDefault : ctx.compressed
  return compressed ? compressedFormat.apply(this, arguments) : uncompressedFormat.apply(this, arguments)
}
@vybs
Copy link
Contributor

vybs commented Feb 21, 2013

similar to : #238 (comment)

But this ticket addresses different modes as well

@sethkinast
Copy link
Contributor

Closing based on resolution in #238 via #511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants