aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/instant/webpack.config.js')
-rw-r--r--packages/instant/webpack.config.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js
index 3129e13a6..ccbbe7359 100644
--- a/packages/instant/webpack.config.js
+++ b/packages/instant/webpack.config.js
@@ -1,7 +1,15 @@
+const childProcess = require('child_process');
const path = require('path');
-const ip = require('ip');
+const webpack = require('webpack');
+
// The common js bundle (not this one) is built using tsc.
// The umd bundle (this one) has a different entrypoint.
+
+const GIT_SHA = childProcess
+ .execSync('git rev-parse HEAD')
+ .toString()
+ .trim();
+const ip = require('ip');
const config = {
entry: './src/index.umd.ts',
output: {
@@ -10,6 +18,16 @@ const config = {
library: 'zeroExInstant',
libraryTarget: 'umd',
},
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.env': {
+ NODE_ENV: JSON.stringify(process.env.NODE_ENV),
+ GIT_SHA: JSON.stringify(GIT_SHA),
+ ENABLE_HEAP: JSON.stringify(process.env.ENABLE_HEAP),
+ NPM_PACKAGE_VERSION: JSON.stringify(process.env.npm_package_version),
+ },
+ }),
+ ],
devtool: 'source-map',
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],