Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

This package has been deprecated

Author message:

No intend to update for Parcel V2

parcel-plugin-sitemap

2.1.6 • Public • Published

Parcel Sitemap Plugin

A parcel plugin for creating (very) basic sitemaps.

Disclaimer:

This plugin will not create a fully featured sitemap, but the most basic one, that is still valid. Parcel makes it generally very easy for you to create a sitemap manually, as html files keep their names while beeing processed. So if you want to achieve perfect SEO optimization you should not use this plugin but create a sitemap manually.

However, if you just want to make sure all pages are listed so that search engines can crawl them, this plugin has you covered.

Installation

npm install parcel-plugin-sitemap

Usage

Add the following snippet to your package.json file and replace "https://www.example.org/" with the location where your site will be hosted:

{
    "sitemap": {
        "siteURL": "https://www.example.org/"
    }
}

Alternatively the homepage key can be used as a comfort options:

{
    "homepage": "https://www.example.org/"
}

Excluding

Files can be excluded from being added to the sitemap by specifying globs in the respective package.json field. The glob(s) will be negated and passed to fast-glob under the hood.

"sitemap": {
    "siteURL": "https://www.example.org/",
    "exclude": "static/**/*",
    /* Using an array of globs */
    "exclude": [
        "static/**/*",
        "exclude.html"
    ]
}

Timing (using with a prerenderer)

In certain cases the sitemap generation should wait until a prerenderer has finished execution. This is a timing issue, that is out of scope for this project. You should wait until the parcel process has exited and then use another tool or script to build your sitemap. So if your sitemap tool is called "sitemap-generator" you should modify your build-command to read somthing similar to

npm run build && sitemap-generator

License

MIT License

Install

npm i parcel-plugin-sitemap

DownloadsWeekly Downloads

9

Version

2.1.6

License

MIT

Unpacked Size

5.78 kB

Total Files

4

Last publish

Collaborators

  • avatar