Closed qfox closed 7 years ago
In v7:
$ npm i bem-xjst@7 bem-xjst@7.7.4 node_modules/bem-xjst $ node -p "require('bem-xjst').bemhtml.generate()" > out-v7.js $ node -p "require('./out-v7.js').apply({block:'qwe'});" <div class="qwe"></div>
In v8:
$ npm i bem-xjst@8 bem-xjst@8.6.11 node_modules/bem-xjst node -p "require('bem-xjst').bemhtml.generate()" > out-v8.js [eval]:1 require('./out-v8.js').apply({block:'qwe'});
But at the same time:
$ node -p "require('./out-v8.js'); global.bemhtml.apply({block:'qwe'});" <div class="qwe"></div>
Perhaps it should not work like this and put bemhtml variable into the global.
bemhtml
global
I've made a PR for testing CJS: https://github.com/bem/bem-xjst/pull/457
Fixed in https://github.com/bem/bem-xjst/pull/457
In v7:
In v8:
But at the same time:
Perhaps it should not work like this and put
bemhtml
variable into theglobal
.I've made a PR for testing CJS: https://github.com/bem/bem-xjst/pull/457