Set ENV in webpack and always log in development
This commit is contained in:
parent
53efd55890
commit
e55ba15613
4 changed files with 12 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import store from 'store.js';
|
import store from 'store.js';
|
||||||
|
|
||||||
const env = process.env.NODE_ENV || 'production';
|
const env = ENV;
|
||||||
const config = require(`./config/${env}`);
|
const config = require(`./config/${env}`);
|
||||||
const logs = [];
|
const logs = [];
|
||||||
const app = {
|
const app = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const redux = require('redux');
|
const redux = require('redux');
|
||||||
const thunk = require("redux-thunk").default;
|
const thunk = require("redux-thunk").default;
|
||||||
const env = process.env.NODE_ENV || 'production';
|
const env = ENV;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createLogger
|
createLogger
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const webpack = require('webpack')
|
||||||
const appPath = path.resolve(__dirname, 'js');
|
const appPath = path.resolve(__dirname, 'js');
|
||||||
|
|
||||||
const PATHS = {
|
const PATHS = {
|
||||||
|
@ -18,6 +19,11 @@ module.exports = {
|
||||||
root: appPath,
|
root: appPath,
|
||||||
extensions: ['', '.js', '.jsx', '.css'],
|
extensions: ['', '.js', '.jsx', '.css'],
|
||||||
},
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
ENV: JSON.stringify("development"),
|
||||||
|
}),
|
||||||
|
],
|
||||||
module: {
|
module: {
|
||||||
preLoaders: [
|
preLoaders: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const webpack = require('webpack')
|
||||||
const WebpackNotifierPlugin = require('webpack-notifier')
|
const WebpackNotifierPlugin = require('webpack-notifier')
|
||||||
|
|
||||||
const appPath = path.resolve(__dirname, 'js');
|
const appPath = path.resolve(__dirname, 'js');
|
||||||
|
@ -25,6 +26,9 @@ module.exports = {
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new WebpackNotifierPlugin(),
|
new WebpackNotifierPlugin(),
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
ENV: JSON.stringify("development"),
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
preLoaders: [
|
preLoaders: [
|
||||||
|
|
Loading…
Add table
Reference in a new issue