File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ import combineReducers from './utils/combineReducers'
3
3
import bindActionCreators from './utils/bindActionCreators'
4
4
import applyMiddleware from './utils/applyMiddleware'
5
5
import compose from './utils/compose'
6
+ import isMinifiedOutsideOfProduction from './utils/isMinifiedOutsideOfProduction'
7
+
8
+ if ( isMinifiedOutsideOfProduction ( ) ) {
9
+ var warningMessage = 'You are utilzing minified code outside of NODE_ENV === \'production\'. ' +
10
+ 'This means that you are running a slower development only build of Redux. ' +
11
+ 'Consult tools such as loose-envify (https://github.com/zertosh/loose-envify) for browserify ' +
12
+ 'and DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' +
13
+ 'to build with proper NODE_ENV'
14
+ console . error ( warningMessage )
15
+ }
6
16
7
17
export {
8
18
createStore ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * This is a function that exists for the function isMinifiedOutsideOfProduction to perform a check.
3
+ * If this function does not maintain its name and the NODE_ENV is not === 'production'
4
+ * then we know the user is using minified code outside of production and we should warn
5
+ */
6
+ function isCrushed ( ) {
7
+ return true
8
+ }
9
+ /**
10
+ * Function that checks name of isCrushed and NODE_ENV
11
+ * to determine if code is minified outside of production
12
+ *
13
+ * @returns {Boolean } A boolean value that is based on whether or not code
14
+ * has been minifed outside side of NODE_ENV === 'production'
15
+ */
16
+ export default function isMinifiedOutsideOfProduction ( ) {
17
+ return isCrushed . name !== 'isCrushed' && process . env . NODE_ENV !== 'production'
18
+ }
You can’t perform that action at this time.
0 commit comments