@udixio/theme 1.0.0-beta.29 → 1.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1548,27 +1548,31 @@ var ConfigService = /*#__PURE__*/function () {
1548
1548
  }
1549
1549
  };
1550
1550
  _proto.getConfig = function getConfig() {
1551
- var base = node_path.resolve(this.configPath);
1552
- var extensions = ['.js', '.ts', '.jms', '.jcs'];
1553
- var configImport = null;
1554
- for (var _i = 0, _extensions = extensions; _i < _extensions.length; _i++) {
1555
- var ext = _extensions[_i];
1556
- var path = base + ext;
1557
- if (node_fs.existsSync(path)) {
1558
- configImport = require(path);
1559
- break;
1551
+ if (typeof process !== 'undefined' && process.release && process.release.name === 'node') {
1552
+ var base = node_path.resolve(this.configPath);
1553
+ var extensions = ['.js', '.ts', '.jms', '.jcs'];
1554
+ var configImport = null;
1555
+ for (var _i = 0, _extensions = extensions; _i < _extensions.length; _i++) {
1556
+ var ext = _extensions[_i];
1557
+ var path = base + ext;
1558
+ if (node_fs.existsSync(path)) {
1559
+ configImport = require(path);
1560
+ break;
1561
+ }
1560
1562
  }
1561
- }
1562
- if (!configImport) {
1563
- throw new Error('Configuration file not found');
1564
- }
1565
- var config;
1566
- if ('default' in configImport) {
1567
- config = configImport["default"];
1563
+ if (!configImport) {
1564
+ throw new Error('Configuration file not found');
1565
+ }
1566
+ var config;
1567
+ if ('default' in configImport) {
1568
+ config = configImport["default"];
1569
+ } else {
1570
+ config = configImport;
1571
+ }
1572
+ return config;
1568
1573
  } else {
1569
- config = configImport;
1574
+ throw new Error('You must provide configuration object when using this library in a browser.');
1570
1575
  }
1571
- return config;
1572
1576
  };
1573
1577
  return ConfigService;
1574
1578
  }();