In Vue, how to include .htaccess to production usi

2019-08-29 07:09发布

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条回答
唯我独甜
2楼-- · 2019-08-29 08:02

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.

查看更多
登录 后发表回答