diff --git a/package.json b/package.json index 682d95f1..b046f41e 100644 --- a/package.json +++ b/package.json @@ -183,6 +183,7 @@ "babel-eslint": "^10.1.0", "babel-jest": "^26.2.2", "babel-loader": "^8.1.0", + "babel-plugin-transform-inline-environment-variables": "^0.4.3", "eslint": "^7.6.0", "eslint-config-react-app": "3.0.6", "eslint-plugin-flowtype": "^5.2.0", @@ -212,4 +213,4 @@ "js-yaml": "^3.13.1" }, "version": "0.52.0" -} \ No newline at end of file +} diff --git a/server/.babelrc b/server/.babelrc index 838e3999..5bebf003 100644 --- a/server/.babelrc +++ b/server/.babelrc @@ -17,6 +17,15 @@ ] ], "plugins": [ - "transform-class-properties" + "transform-class-properties", + [ + "transform-inline-environment-variables", + { + "include": [ + "SOURCE_COMMIT", + "SOURCE_VERSION" + ] + } + ] ] } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index fc0421ff..8b2eca63 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -50,9 +50,7 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - "process.env.SOURCE_COMMIT": JSON.stringify(process.env.SOURCE_COMMIT), - "process.env.SOURCE_VERSION": JSON.stringify(process.env.SOURCE_VERSION), - "EDITOR_VERSION": JSON.stringify(pkg.version) + EDITOR_VERSION: JSON.stringify(pkg.version) }), new webpack.ProvidePlugin({ fetch: 'imports-loader?this=>global!exports-loader?global.fetch!isomorphic-fetch', diff --git a/yarn.lock b/yarn.lock index 7f44d9cf..a2785361 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2504,6 +2504,11 @@ babel-plugin-transform-class-properties@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" +babel-plugin-transform-inline-environment-variables@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-environment-variables/-/babel-plugin-transform-inline-environment-variables-0.4.3.tgz#a3b09883353be8b5e2336e3ff1ef8a5d93f9c489" + integrity sha1-o7CYgzU76LXiM24/8e+KXZP5xIk= + babel-preset-current-node-syntax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz#cf5feef29551253471cfa82fc8e0f5063df07a77"