参考错误:APP_VERSION 未定义在 baelrc 文件中添加新插件“@babel/plugin-transform-modules-commonjs”时出错

问题描述

当我在控制台中添加 _esmodule = "true" 时,我的应用程序不起作用。它抛出错误为 obj undefined。

但是如果我升级 webpack 版本,我的应用程序可以工作,我希望我的应用程序即使在我不更新我的 webpack 的情况下也能工作,所以用谷歌搜索并发现“@babel/plugin-transform-modules-commonjs插件有助于转换我们的 esmodule 来 comman js。

但是在 babel.rc 中添加我的插件后,如下所示。 "plugins": [ "@babel/plugin-transform-modules-commonjs","lodash","@babel/plugin-transform-object-assign","@babel/plugin-proposal-class-properties",[ "@babel/plugin-transform-react-jsx",{ "pragma": "h" } ] ]

它抛出一个新的错误,告诉“ReferenceError: APP_VERSION is not defined”。请帮我解决这里的问题。提前谢谢你。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)