works with webpack

Trying to read (__dirname + '/package.json') file at run-time won't work with
webpack. Using require('./package.json') instead allows webpack to include
package.json's source into the bundle.
master
sean shirazi 8 years ago
parent c1bef9d4fd
commit 4ee9ddb2c1
  1. 5
      index.js

@ -126,7 +126,4 @@ require("./lib/montage")(gm.prototype);
module.exports = exports = gm;
module.exports.utils = require('./lib/utils');
module.exports.compare = require('./lib/compare')();
module.exports.version = JSON.parse(
require('fs').readFileSync(__dirname + '/package.json', 'utf8')
).version;
module.exports.version = require('./package.json').version;

Loading…
Cancel
Save