Skip to content

Commit

Permalink
works with webpack
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sean shirazi committed Jun 27, 2016
1 parent c1bef9d commit 4ee9ddb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 4ee9ddb

Please sign in to comment.