Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To include a sitemap.xml in Quasar Framework, follow these steps:

  1. Create a sitemap.xml file in the root of your Quasar project.
  2. Add the following code to your quasar.conf.js file:
const SitemapPlugin = require('sitemap-webpack-plugin').default
const paths = ['/', '/about', '/contact'] // add your website routes here

module.exports = function (ctx) {
  return {
    // ...
    build: {
      // ...
      plugins: [
        new SitemapPlugin('https://your-website-url.com', paths)
      ]
    }
  }
}
  1. Replace 'https://your-website-url.com' with your website URL.
  2. Replace the paths array with the routes you want to include in your sitemap.xml.
  3. Run "quasar build" to generate your website files, including the sitemap.xml file.

Note: make sure to include the sitemap.xml file in your server's root directory and add it to the robots.txt file so that search engines can find it easily.