Skip to content

Commit

Permalink
Merge pull request #81 from enb-bem/issue-78
Browse files Browse the repository at this point in the history
Support BEMContext from exports
  • Loading branch information
blond committed Aug 3, 2015
2 parents 745ee44 + ccdf7f9 commit 34421c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions techs/bem-xjst.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ module.exports = require('enb/lib/build-flow').create()
var jobQueue = this.node.getSharedResources().jobQueue,
template = [
'oninit(function(exports, context) {',
' if(!context.BEMContext) {',
' var BEMContext = exports.BEMContext || context.BEMContext;',
' if(!BEMContext) {',
' throw Error("Seems like you have no base templates from i-bem.' + this.getName() + '");',
' }',
' context.BEMContext.prototype.require = function(lib) {',
' BEMContext.prototype.require = function(lib) {',
' return __bem_xjst_libs__[lib];',
' };',
'});'
Expand Down

0 comments on commit 34421c6

Please sign in to comment.