我将react-native-web
模块的别名为webpackConfig.resolve.alias["react-native$"] = "react-native-web";
,如下所示:
react-native
如果我没有在node_modules
中安装react-native
模块,那么一切都很好,但是如果我安装了它(因为我的本机应用需要它),则别名似乎没有工作,它只是尝试导入react-native-web
而不是 DCNDemoListener list = new DCNDemoListener(this);
dcr.addListener(list);
// second step: add objects in the registration:
Statement stmt = conn.createStatement();
// associate the statement with the registration:
((OracleStatement)stmt).setDatabaseChangeRegistration(dcr);
ResultSet rs = stmt.executeQuery("select * from testtable where ID=1");
。
这是Webpack的正常行为吗?如果模块存在,则忽略别名。
答案 0 :(得分:0)
我通过包含react-native
来解决此问题,该文件将由babel装入程序进行编译。不确定为什么我必须这样做,但是只要能奏效,我就会感到高兴。