Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[dev] fix redux devtools (apache#5855)
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster authored Sep 11, 2018
1 parent 965c838 commit 1f6e8b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion superset/assets/src/reduxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions superset/assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1f6e8b3

Please sign in to comment.