You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by cc...@apache.org on 2018/09/11 17:35:55 UTC
[incubator-superset] branch master updated: [dev] fix redux
devtools (#5855)
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 <wi...@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) {