1.0.4 • Published 10 months ago

webpack-sitemap-inject-plugin v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

webpack-sitemap-inject-plugin

NPM Version Node.js Package

Intro

One more webpack plugin for postprocessing of yours sitemap.xml file. Allows to add custom elements to already existing sitemap.xml over webpack.

Installation

npm install --save-dev webpack-sitemap-inject-plugin

How to use

In your webpack.config.js you should add WebpackSitemapInjectPlugin definition with required options:

const WebpackSitemapInjectPlugin = require("webpack-sitemap-inject-plugin");

module.exports = {
  // ....
  plugins: [
    //...
    new WebpackSitemapInjectPlugin({
      sitemapPath: 'sitemap.xml', // Path to input sitemap.xml in your outputs
      sitemapOutputPath: 'sitemap.xml', // Path to input sitemap.xml (overrides existing input by default)
      baseUrl: 'https://yourwebsite.com', // your site base url
      fillTimestamps: true, // enable automatically fill `lastmod` tag with current timestamp
      routes: [
        { path: '/', priority: '1.0', changefreq: 'daily' },
        { path: '/about', priority: '0.9', changefreq: 'monthly' },
        { path: '/contact', priority: '0.9', changefreq: 'monthly' },
      ]
    }),
  ],
};

See full example in examples/webpack.config.js folder

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago