Skip to content
A dead simple Mimosa module that will modify handlebars.js and attach Handlebars to the window object
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.



This module will modify handlebars.js and add a line of code that attaches Handlebars to the window.


When requirejs/r.js is used to optimize and minify Ember projects (Ember 1.3), Ember has issues finding Handlebars. I found that updating the handlebars.js file in place and attaching Handlebars to the window solves that problem.

Why not just update the code?

If you are using Bower to manage project dependencies, then updating those dependencies is a bad idea because they will just get overwritten. So this module does its work after Bower has pulled in dependencies.

For more information regarding Mimosa, see


Add 'handlebars-on-window' to your list of modules. That's all! Mimosa will install the module for you when you start mimosa watch or mimosa build.


This module will detect the handlebars.js file and update the code slightly to attach Handlebars to window. It will detect if it is already attached to the window before updating the code. If it is already attached to window, this module may be unnecessary, so this module will write to the console when it finds it has no work to do with the handlebars.js file.

Default Config

handlebarsOnWindow: {
  libName: "handlebars.js",
  replace: "__exports__ = Handlebars"
  • libName: The name of your handlebars file.
  • replace: The string to prepend window.Handlebars = to in libName
You can’t perform that action at this time.