使用本机脚本“ tns创建my-tab-ng --template tns-template-tab-navigation-ng”模板后,没有webpack.config.js文件

问题描述

每当我尝试使用连接到计算机的设备来运行命令tns run android时,都会发生错误,找不到webpack.config.js文件。我使用tns create my-tab-ng --template tns-template-tab-navigation-ng创建了项目。模板不应该创建webpack.config.js文件吗?请问我做错了什么?

解决方法

我遇到了同样的问题,幸运的是我可以解决它。我希望它也对您有用。 我什至不记得为什么要设置此配置,我想我在某处读到了推荐设置,但这肯定给我带来了很多痛苦和时间浪费:

通过以下方法检查设置: npm配置获取忽略脚本

如果返回true,则将其设置为false: npm配置设置为false的脚本

,

尝试迁移

ng migrate --force

它会为你添加 webpack.config.js