Set ENV in webpack and always log in development

This commit is contained in:
6ea86b96 2017-05-23 11:41:26 +04:00
parent 53efd55890
commit e55ba15613
No known key found for this signature in database
GPG key ID: B282D183E4931E8F
4 changed files with 12 additions and 2 deletions

View file

@ -1,6 +1,6 @@
import store from 'store.js';
const env = process.env.NODE_ENV || 'production';
const env = ENV;
const config = require(`./config/${env}`);
const logs = [];
const app = {

View file

@ -1,6 +1,6 @@
const redux = require('redux');
const thunk = require("redux-thunk").default;
const env = process.env.NODE_ENV || 'production';
const env = ENV;
import {
createLogger

View file

@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack')
const appPath = path.resolve(__dirname, 'js');
const PATHS = {
@ -18,6 +19,11 @@ module.exports = {
root: appPath,
extensions: ['', '.js', '.jsx', '.css'],
},
plugins: [
new webpack.DefinePlugin({
ENV: JSON.stringify("development"),
}),
],
module: {
preLoaders: [
{

View file

@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack')
const WebpackNotifierPlugin = require('webpack-notifier')
const appPath = path.resolve(__dirname, 'js');
@ -25,6 +26,9 @@ module.exports = {
},
plugins: [
new WebpackNotifierPlugin(),
new webpack.DefinePlugin({
ENV: JSON.stringify("development"),
}),
],
module: {
preLoaders: [