2954e7ea66
If `global` is used and handlebars is compiled for browser usage without a Node.js `global` polyfill, handlebars fails with a `global is undefined` error. Fixes #1593
13 lines
379 B
JavaScript
13 lines
379 B
JavaScript
export default function(Handlebars) {
|
|
/* istanbul ignore next */
|
|
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
|
|
$Handlebars = root.Handlebars;
|
|
/* istanbul ignore next */
|
|
Handlebars.noConflict = function() {
|
|
if (root.Handlebars === Handlebars) {
|
|
root.Handlebars = $Handlebars;
|
|
}
|
|
return Handlebars;
|
|
};
|
|
}
|