使用taro开发钉钉的E应用报错 You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://git

今天测试taro转钉钉E应用的时候,在模拟器上没事,但是在真机上却报错了:

You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.

原因是引入的React没有切换到产品版本,按照提示安装了loose-envify等相关插件,还是不好使,最后找到了这个办法:在 package.json 文件中,这里安装了一个插件npm install cross-env --save-dev,然后,将scripts中的zNODE_ENV='production'前加上cross-env,这样就能在 Mac 和 Windows 同样的功能

这样就可以了

 

posted @ 2018-12-11 10:47  明明一颗大白菜  阅读(5337)  评论(1编辑  收藏  举报
<-- -->