This package has been deprecated

Author message:

This package is no longer maintained. Please fork it or move to something else.

@jahed/webpack-sitemap
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

webpack-sitemap

Travis npm Patreon Liberapay

Generate Sitemaps as part of your Webpack build.

Installation

# Yarn
yarn add --dev @jahed/webpack-sitemap

# NPM
npm install --save-dev @jahed/webpack-sitemap

Example

Here's how you might use this plugin in your webpack.config.js:

import { SitemapPlugin } from '@jahed/webpack-sitemap'

// ...
plugins: [
    //...
    new SitemapPlugin({
        basename: 'https://example.com',
        sitemapindex: {
            'app': {
                urlset: {
                    '/some/page': {
                        priority: 0.9
                    }
                }
            }
        },
        defaults: {
            sitemap: {
                lastmod: new Date().toISOString()
            },
            url: {
                lastmod: new Date().toISOString(),
                priority: 0.5,
                changefreq: 'daily'
            }
        }
    })
    //...
]
//...

This will generated the following:

<?xml version="1.0" encoding="UTF-8"?>
<!-- /sitemap.xml -->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://example.com/sitemaps/app.xml</loc>
        <lastmod>2017-11-29T00:39:29.258Z</lastmod>
    </sitemap>
</sitemapindex>
<?xml version="1.0" encoding="UTF-8"?>
<!-- /sitemaps/app.xml -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://example.com/some/page</loc>
        <lastmod>2017-11-29T00:39:29.258Z</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.9</priority>
    </url>
</urlset>

Readme

Keywords

none

Package Sidebar

Install

npm i @jahed/webpack-sitemap

Weekly Downloads

52

Version

1.0.5

License

MIT

Unpacked Size

12.8 kB

Total Files

14

Last publish

Collaborators

  • jahed