Browse Source

Merge pull request #119 from loeck/master

Fix dotenv
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
76fef79459
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package.json
  2. 2
      src/env.js
  3. 4
      src/main/index.js
  4. 2
      webpack/plugins.js

2
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",

2
src/env.js

@ -1,3 +1,5 @@
import 'dotenv/config'
process.env = {
...process.env,
NODE_ENV: (process.env || {}).NODE_ENV || 'production',

4
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')

2
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__,

Loading…
Cancel
Save