superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccwilli...@apache.org
Subject [incubator-superset] branch master updated: [dev] fix redux devtools (#5855)
Date Tue, 11 Sep 2018 17:35:55 GMT
This is an automated email from the ASF dual-hosted git repository.

ccwilliams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f6e8b3  [dev] fix redux devtools (#5855)
1f6e8b3 is described below

commit 1f6e8b31d28ae6313e02ae542b77d0b808a89d9a
Author: Chris Williams <williaster@users.noreply.github.com>
AuthorDate: Tue Sep 11 10:35:52 2018 -0700

    [dev] fix redux devtools (#5855)
---
 superset/assets/src/reduxUtils.js | 2 +-
 superset/assets/webpack.config.js | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/reduxUtils.js b/superset/assets/src/reduxUtils.js
index 4a8d944..5bd2565 100644
--- a/superset/assets/src/reduxUtils.js
+++ b/superset/assets/src/reduxUtils.js
@@ -70,7 +70,7 @@ export function addToArr(state, arrKey, obj, prepend = false) {
 
 export function initEnhancer(persist = true) {
   let enhancer = persist ? compose(persistState()) : compose();
-  if (process.env.NODE_ENV === 'dev') {
+  if (process.env.WEBPACK_MODE === 'development') {
     /* eslint-disable-next-line no-underscore-dangle */
     const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
     enhancer = persist ? composeEnhancers(persistState()) : composeEnhancers();
diff --git a/superset/assets/webpack.config.js b/superset/assets/webpack.config.js
index 3347171..d1c5cbd 100644
--- a/superset/assets/webpack.config.js
+++ b/superset/assets/webpack.config.js
@@ -35,6 +35,11 @@ const plugins = [
 
   // create fresh dist/ upon build
   new CleanWebpackPlugin(['dist']),
+
+  // expose mode variable to other modules
+  new webpack.DefinePlugin({
+    'process.env.WEBPACK_MODE': JSON.stringify(mode),
+  }),
 ];
 
 if (isDevMode) {


Mime
View raw message