diff --git a/techs/i18n.js b/techs/i18n.js index 582fa0c..70455bc 100644 --- a/techs/i18n.js +++ b/techs/i18n.js @@ -72,8 +72,9 @@ module.exports = require('enb/lib/build-flow').create() commonJS = opts.exports.commonJS || '', ym = opts.exports.ym || '', globals = opts.exports.globals || '', - isForcedGlobalExports = opts.exports.globals === 'force'; + defineAsGlobal = ' defineAsGlobal = false;'; + opts.exports.globals === 'force' && (defineAsGlobal = ''); return [ '(function (global) {', ' var __i18n__ = ' + compile(parsed.core, parsed.keysets, opts) + ',', @@ -83,8 +84,7 @@ module.exports = require('enb/lib/build-flow').create() ' // CommonJS', ' if (typeof exports === "object") {', ' module.exports = __i18n__;', - isForcedGlobalExports === 'force' ? '' : - ' defineAsGlobal = false;', + defineAsGlobal, ' }' ].join(EOL), '', @@ -94,8 +94,7 @@ module.exports = require('enb/lib/build-flow').create() ' modules.define("i18n", function (provide) {', ' provide(__i18n__);', ' });', - isForcedGlobalExports === 'force' ? '' : - ' defineAsGlobal = false;', + defineAsGlobal, ' }' ].join(EOL), '',