webpack-sitemap-inject-plugin
v1.0.4
Published
Wepback plugin for customizing and regeneration of sitemap.xml
Downloads
5
Maintainers
Readme
webpack-sitemap-inject-plugin
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