-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I'm using prest-client in a project that bundles code using Webpack and the following line throws:
Line 4 in ca2f79c
| lib.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version; |
I've created a patch locally using yarn but others might run into this too. Node.js and Webpack support importing package.json directly which should be well supported by other bundlers that support Node.js:
diff --git a/index.js b/index.js
index 0f5fe1cb2b9ce459711f1eb29eaa002405f0fd60..e77aed24d74cf5b5eb3e3c9a4d14b2631516ce9f 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,6 @@
var fs = require('fs');
var lib = require('./lib/presto-client');
-lib.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version;
+lib.version = require('./package.json').version;
exports.Client = lib.Client;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels