From 119f2299714b0a576692beca31530be9613226ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=ABck=20V=C3=A9zien?= Date: Wed, 14 Feb 2018 11:45:39 +0100 Subject: [PATCH] Fix dotenv --- package.json | 2 +- src/env.js | 2 ++ src/main/index.js | 4 ++-- webpack/plugins.js | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 91df9757..855b467e 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "babel-preset-stage-0": "^6.24.1", "chance": "^1.0.13", "concurrently": "^3.5.1", - "dotenv-webpack": "^1.5.4", + "dotenv": "^5.0.0", "electron": "1.8.2", "electron-builder": "^20.0.4", "electron-devtools-installer": "^2.2.3", diff --git a/src/env.js b/src/env.js index 5558f6c4..cd106d80 100644 --- a/src/env.js +++ b/src/env.js @@ -1,3 +1,5 @@ +import 'dotenv/config' + process.env = { ...process.env, NODE_ENV: (process.env || {}).NODE_ENV || 'production', diff --git a/src/main/index.js b/src/main/index.js index 25424d71..bf6ee547 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,5 +1,7 @@ // @flow +require('env') + const { SENTRY_URL } = process.env if (__PROD__ && SENTRY_URL) { @@ -8,8 +10,6 @@ if (__PROD__ && SENTRY_URL) { Raven.config(SENTRY_URL, ravenConfig).install() } -require('env') - process.setMaxListeners(0) require('../globals') diff --git a/webpack/plugins.js b/webpack/plugins.js index cd40a36a..3219e3b8 100644 --- a/webpack/plugins.js +++ b/webpack/plugins.js @@ -1,10 +1,8 @@ const webpack = require('webpack') -const Dotenv = require('dotenv-webpack') require('../src/globals') module.exports = [ - new Dotenv(), new webpack.DefinePlugin({ __DEV__, __PROD__,