diff --git a/karma.conf.js b/karma.conf.js index bf634061..d646392e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,5 @@ +const webpackConfig = require('./webpack.config'); + module.exports = function(config) { config.set({ files: [ @@ -14,9 +16,7 @@ module.exports = function(config) { browsers: ['Chrome'], - webpack: { - devtool: 'inline-source-map' - }, + webpack: webpackConfig, webpackServer: { noInfo: true diff --git a/src/index.js b/src/index.js index 72b8f4d6..668d5f82 100644 --- a/src/index.js +++ b/src/index.js @@ -282,5 +282,6 @@ function initialize(env, user, options) { } module.exports = { - initialize: initialize + initialize: initialize, + version: VERSION }; diff --git a/webpack.config.js b/webpack.config.js index 73e770d0..f57a3660 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,14 @@ +const webpack = require('webpack'); +const package = require('./package.json'); + module.exports = { output: { library: 'LDClient', libraryTarget: 'umd' - } + }, + plugins: [ + new webpack.DefinePlugin({ + VERSION: JSON.stringify(package.version) + }) + ] };