Skip to content

Commit

Permalink
Merge pull request #32 from PeculiarVentures/env-config
Browse files Browse the repository at this point in the history
Fix ENV_CONFIG for Windows
  • Loading branch information
donskov authored Mar 25, 2019
2 parents c304474 + 2828712 commit 13253bd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bundler/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint "import/no-extraneous-dependencies": 1 */

require("./config");

// Do this as the first thing so that any code reading it knows the right env.
if (!process.env.NODE_ENV) {
process.env.BABEL_ENV = 'production';
Expand Down
1 change: 1 addition & 0 deletions bundler/scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.ENV_CONFIG="env/.env";
3 changes: 3 additions & 0 deletions bundler/scripts/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* eslint "import/no-extraneous-dependencies": 1 */

require("./config");

const express = require('express');
const path = require('path');
const getClientEnvironment = require('../utils/env');
Expand Down
2 changes: 2 additions & 0 deletions bundler/scripts/start.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint "import/no-extraneous-dependencies": 1 */

require("./config");

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"main": "index.js",
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean && ENV_CONFIG=env/.env node bundler/scripts/build",
"start": "npm run clean && ENV_CONFIG=env/.env node bundler/scripts/start",
"server": "ENV_CONFIG=env/.env node bundler/scripts/server",
"build": "npm run clean && node bundler/scripts/build",
"start": "npm run clean && node bundler/scripts/start",
"server": "node bundler/scripts/server",
"lint": "eslint src bundler",
"deploy": "gh-pages -d dist"
},
Expand Down

0 comments on commit 13253bd

Please sign in to comment.