Explorar o código

use process env variables if dotenv doesn't find file

jnfrati %!s(int64=4) %!d(string=hai) anos
pai
achega
4c4d1045db
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      dashboard/webpack.config.js

+ 4 - 1
dashboard/webpack.config.js

@@ -11,7 +11,10 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
 const TerserPlugin = require("terser-webpack-plugin");
 
 module.exports = () => {
-  const env = dotenv.config().parsed;
+  let env = dotenv.config().parsed;
+  if (!env) {
+    env = process.env;
+  }
   const envKeys = Object.keys(env).reduce((prev, next) => {
     prev[`process.env.${next}`] = JSON.stringify(env[next]);
     return prev;