In Vue, how to include .htaccess to production using npm run build?

懵懂的女人 提交于 2019-12-24 04:22:03

问题


I'm using Vue CLI 3 and vue-router mode history and had this problem. Found out that after I run npm run build, I need to put .htaccess inside the dist folder.

How to make npm run build to automatically include the .htaccess so that I don't need to manually copy it into dist folder?


回答1:


It might sound obvious, but placing the .htaccess inside the public folder seems to do the trick for me. Everything contained in public folder is copied as is to dist folder during build.



来源:https://stackoverflow.com/questions/52397542/in-vue-how-to-include-htaccess-to-production-using-npm-run-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!