Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Allow multiple umd files to load into global.vuei18nLocales (#98)
Browse files Browse the repository at this point in the history
* Allow multiple umd files to load into global.vuei18nLocales

* IE support?

* update tests
  • Loading branch information
murrant authored Feb 9, 2020
1 parent f546c3f commit 95fcfa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private function getUMDModule($body)
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.vuei18nLocales = factory());
typeof global.vuei18nLocales === 'undefined' ? global.vuei18nLocales = factory() : Object.keys(factory()).forEach(function (key) {global.vuei18nLocales[key] = factory()[key]});
}(this, (function () { 'use strict';
return {$body}
})));
Expand Down
2 changes: 1 addition & 1 deletion tests/GenerateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function testBasicWithUMDFormat()
'(function (global, factory) {' . PHP_EOL
. ' typeof exports === \'object\' && typeof module !== \'undefined\' ? module.exports = factory() :' . PHP_EOL
. ' typeof define === \'function\' && define.amd ? define(factory) :' . PHP_EOL
. ' (global.vuei18nLocales = factory());' . PHP_EOL
. ' typeof global.vuei18nLocales === \'undefined\' ? global.vuei18nLocales = factory() : Object.keys(factory()).forEach(function (key) {global.vuei18nLocales[key] = factory()[key]});' . PHP_EOL
. '}(this, (function () { \'use strict\';' . PHP_EOL
. ' return {' . PHP_EOL
. ' "en": {' . PHP_EOL
Expand Down

0 comments on commit 95fcfa0

Please sign in to comment.