How to turn on/off ReactJS 'development mode'?

后端 未结 7 1295
独厮守ぢ
独厮守ぢ 2020-11-29 17:38

Started using ReactJS\'s prop validation feature, which as the docs say only works in \'development mode\' for performance reasons.

React seems to be validating the

7条回答
  •  时光说笑
    2020-11-29 18:06

    For webpack based build, I used to setup separate webpack.config.js for DEV and PROD. For Prod, resolve the alias as below

         alias: {
            'react$': path.join(__dirname, 'node_modules', 'react','dist','react.min.js'),
            'react-dom$': path.join(__dirname, 'node_modules', 'react-dom','dist','react-dom.min.js')
        }
    

    You can find the working one from here

提交回复
热议问题