Skip to content

Commit fea2c4b

Browse files
authored
Merge pull request #36 from Moesif/handle-when-json-can-not-be-imported
handle when json files import not supported by bundler
2 parents 1caf274 + 3e04203 commit fea2c4b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/configuration.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
*
44
*
55
*/
6-
pjson = require('../package.json');
6+
var pjson = require('../package.json');
7+
8+
// some bundlers prevents import of json files
9+
var version = pjson ? pjson.version : '2.1.6';
710

811
var configuration = {
912
//The base Uri for API calls
1013
BaseUri : "https://api.moesif.net",
1114

1215
//Your Application Id for authentication/authorization
1316
ApplicationId : "SET_ME",
14-
UserAgent : 'moesifapi-nodejs/' + pjson.version
17+
UserAgent : 'moesifapi-nodejs/' + version
1518

1619
};
1720

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moesifapi",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"description": "Collection/Data Ingestion API for Moesif",
55
"main": "./lib/index.js",
66
"keywords": [

0 commit comments

Comments
 (0)