小白一个,跟着网上的教程配置了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

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐