2.1.6 • Published 4 years ago

parcel-plugin-sitemap v2.1.6

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

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

2.1.6

4 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

6 years ago