What is the way to add a .txt file to a Vue single-page application, so it's visible online?
For example, if I want sitemap.txt
to appear on myvuewebsite.com at myvuewebsite.com/sitemap.txt ?
What is the way to add a .txt file to a Vue single-page application, so it's visible online?
For example, if I want sitemap.txt
to appear on myvuewebsite.com at myvuewebsite.com/sitemap.txt ?
What I think you can do is to put the sitemap.txt file in your public folder and in your router --> index.js
{ path: "/sitemap.txt"}
After you've run npm run build, add the sitemap.txt file to the top-level of your "dist" folder, which is where your build files are.
Note: You need to add the .txt file every time you rebuild the "dist" folder, so this isn't a great solution.