nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit 3860b7acbe818eb1c463d5b15f8c52b0a69f02b7
parent a41fc3f667021fdbfc236656250252fe2398bf25
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Tue,  3 Dec 2019 09:15:11 +0100

config: pass env vars to code: NODE_ENV, RELEASE_VER

Diffstat:
M.eslintrc | 3+++
Mwebpack/webpack.common.js | 5+++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/.eslintrc b/.eslintrc @@ -10,5 +10,8 @@ "sourceType": "module" }, "rules": { + "globals": { + "NODE_ENV": true, + "RELEASE_VER": true } } \ No newline at end of file diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js @@ -1,3 +1,4 @@ +const Webpack = require('webpack'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -25,6 +26,10 @@ module.exports = { ]), new HtmlWebpackPlugin({ template: paths.appIndexHtml + }), + new Webpack.DefinePlugin({ + 'NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'), + 'RELEASE_VER': JSON.stringify(process.env.RELEASE_VER || 'local devel') }) ], resolve: {