Sitemap.xml not loading in vue3 production site - vue.js

Added sitemap.xml to the vue3 project. When calling http://127.0.0.1:5173/sitemap.xml it is showing sitemap. Also showing sitemap after creating build localhost/sitemap.xml. But in production, the site map is not loading.
Any idea why sitemap.xml not working in production. i am using AWS Amplify for production.
I kept the sitemap.xml file in root as well as in the public folder.

Related

Upload file of Shopware PWA on server(Server Side Rendering)

Hii Can anyone help me to upload the Shopware PWA on the server(Server Side Rendering). I have tried almost all the methods mentioned on the nuxt js official website but I can't upload the PWA on the server. By using yarn generate, it converts the PWA on the static website so when I changed it on the backend it doesn't reflect on the PWA(like category, pages, etc) and also doesn't change the title of the website dynamically. and I have also tried this method https://www.niagahoster.co.id/blog/upload-nuxtjs-di-hosting/ but it also doesn't work for me.

Publishing a finished SPA on Vue for hosting

Good evening, there is a ready spa written in a vue.cli. How can I upload it to the hosting for publishing?
I'm not sure if vue.cli would support this feature, although I have a solution that does not use vue.cli but it does belong to the vue.js universe, I'm reffering to the Nuxt.js cli.
You can simply use SPA mode using nuxt --spa. In combination with the generate feature, it gives you a powerful SPA deployment mechanism without the need to use a Node.js runtime or any special server handling.
The SPA idea is simple! When SPA mode is enabled using mode: 'spa' or --spa flag, and we run build, generation automatically starts after the build. This generation contains common meta and resource links, but not page content - this one you'll have to create on your own of course, but you won't need to worry about SEO matters on your static code.
So, for an SPA deployment, you must do the following:
Change mode in nuxt.config.js to spa.
Run npm run build.
Deploy the created dist/ folder to your static hosting like Surge, GitHub Pages or nginx.
More on:
https://nuxtjs.org/guide/#single-page-applications-spa-
https://nuxtjs.org/guide/commands#single-page-application-deployment-spa-
If nuxt.js is totally new to you, there's a nice introduction on the official website:
https://nuxtjs.org/guide
Hope it helps

Create React App - Router paths not serving javascript

I have a CRA site that has been deployed to Amazon S3.
When the router paths have a / in the url the Javascript or CSS is no longer loading. (i.e. it's trying to load from example.com/subdomain/static rather than example.com/static)
I've tried setting PUBLIC_URL='/' in .env.production and that's not helping.
Any clues on how to get URLs working again.
Any
homepage was not set correctly in package.json

How to render a template in VueJS to be used on index.html

We have Rails app with Webpacker that serves just the initial HTML file, after which the client will download everything (inc. vue .js and .css) files.
Our problem is that we want to display something initial on the html so the user will feel as the site already loaded. This logic is in the main vuejs component. Is there a way to offline render this so it will be easily be embedded on our index page? instead of having to maintain and re-write this everytime?
It sounds like pre-rendering might be a better fit for you than full-on SSR. Since you're already rolling Webpack, there is a plugin that helps to that end called prerender-spa-plugin: https://github.com/chrisvfritz/prerender-spa-plugin
The idea behind this plugin is that, as part of your build process, it prerenders the resulting static HTML of your SPA using Puppeteer (i.e. headless Chrome), and drops it into your static HTML folder. It maintains links to your SPA code so it's still fully functional, it's just fully rendered by the time the user hits it.
What I'd suspect you'd want to try is the following:
Add the prerender-spa-plugin to your webpack.config.js
Configure the plugin to prerender your initial route and any additional routes that are truly static
Output the resulting files to the folder your Rails app uses to distribute static assets (HTML, CSS, images, etc)
Going the pre-render route is actually technically superior to SSR for truly static routes like a landing page or marketing pages. You won't need to mess with a complex pre-render setup on your Rails server, you offload content distribution to the static folder (i.e. lesser load on your Rails server), and you still get to use all the benefits of your SPA.
That being said, if you strongly feel like you do need full-blown SSR, the generally "accepted" approach is rolling a Node.js server (https://ssr.vuejs.org/). If you decide to go down this route, I'd keep your SPA assets in their own separate Git repo from your Rails server and manage DevOps appropriately.
Good luck!

Bundle Multiple CSS Served From a CDN?

We are looking into the new bundling feature of ASP.NET MVC 4 and are wondering if there are any advantages to bundling CSS files that are served from a CDN?
Is there even a way to bundle multiple files served up from a CDN in ASP.NET MVC 4?
This doesn't work:
var cdnCssPath = "http://MyCdn/css/";
bundles.Add(new StyleBundle("~/Content/css", cdnCssPath)
.Include("~/Content/site.css")
.Include("~/Content/Test1.css")
.Include("~/Content/Test2.css")
.Include("~/Content/Test3.css")
);
Any ideas?
First of all it depends on if you have access to a CDN where you can upload your own files or if you're using, for example, google's CDN to get external libraries like jQuery.
If you pull files from a CDN and bundle them, you would lose the advantage of using a CDN unless you're able to upload your new bundled file to the CDN.
For example if you get jQuery and jQuery UI from google's CDN and bundle them, you're no longer using google's CDN, you're instead serving up local resources (the created bundle).
You may have reduced the number of requests, but instead of 2 requests too google's CDN (which has a high probabillity to be cached already by the users browser) there's one request to your server (which is not as likely to be cached).
So in short I would say that there's no advantage to bundle files together that comes from a CDN, however uploading your bundled files to a CDN is different story.
Do note that it is possible to use use CDN for bundles though:
look at the "Using a CDN" part of this article
Edit: Here's an article that explains when to use a CDN or not and why, a bit more indepth than my answer http://www.kendoui.com/blogs/teamblog/posts/13-11-07/know-when-to-cdn.aspx