小白一个,跟着网上的教程配置了Vue,到npm run serve时出现了Multiple assets emit different content to the same filename index.html的报错。网上搜了一圈,大概知道原因是打包时重名了,但CSDN上的解决方案都试了一遍,并没有什么*用,bug越修越多……直到看到roadhog2配置项html,报错:Conflict: Multiple assets emit to the same filename index.html: · Issue #709 · sorrycc/roadhog · GitHub这个,终于解决了问题。

解决方法是把index.html重命名为index.ejs,在node_nodules/webpack/bin/webpack.js中加入

html: { template: './src/index.ejs' }
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐