- Fix for webpack 4 pre-4.40 not having
compilation.emitAsset
- Plugin source is now TypeScript and type declaration files are included when installed from npm
- First stable release! 🎉
- Plugin now accepts a single options object to match the webpack convention.
- Added schema validation for plugin configuration.
- Dropped support for deprecated camel-cased option names. "changefreq", "filename", "lastmod", and "skipgzip" must now be lowercase.
- To upgrade from 0.x: 1) change the plugin arguments to a single object as detailed below, and 2) downcase any camel-cased option names as mentioned in the previous bullet.
// Before:
{
// snip
plugins: [
new SitemapPlugin(
'https://mysite.com',
[
{
path: '/foo/',
lastMod: '2015-01-04',
priority: '0.8',
changeFreq: 'daily'
},
{
path: '/bar/',
}
],
{
fileName: 'map.xml',
lastMod: true,
changeFreq: 'monthly',
priority: '0.4'
}
)
]
}
// After:
{
// snip
plugins: [
new SitemapPlugin({
base: 'https://mysite.com',
paths: [
{
path: '/foo/',
lastmod: '2015-01-04',
priority: 0.8,
changefreq: 'daily'
},
{
path: '/bar/',
}
],
options: {
filename: 'map.xml',
lastmod: true,
changefreq: 'monthly',
priority: 0.4
}
})
]
}
- Use new API on webpack 5 to remove deprecation warning.
- Use native
new Date().toISOString()
to generate dates, rather than a more complicated custom date function. This prevents an error in certain locales.
- Updated and expanded README documentation
- Standardize on non-camel-cased configuration values for consistency with underlying
sitemap
package (camel-cased values are still supported for backwards compatibility)
- Allow providing a top-level date string for
lastmod
(if a boolean true
is provided, the current date will still be used for backwards compatibility)
- Switched to sitemap package for generating sitemaps under the hood, which provides more configuration options
- Upgrade for compatibility with webpack 4 (breaks compatibility with webpack <=3)
- Emit gzipped sitemap alongside the unzipped file (skippable with
skipGzip
configuration)
- Fix
size
function in emitted asset (bug where wrong variable name was used)
- Change API to accept
base, paths, options
as arguments
- Add
fileName
configuration option
- Allow passing an array of path objects in addition to strings
- Misc other improvements