Instead of checking NODE_ENV and adding conditionals, this also works:

import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';

(...)

export default composeWithDevTools(applyMiddleware(thunkMiddleware, promise));