Skip to content

Minify xml #64

@juchom

Description

@juchom

Hello again,

Continuing my journey with 11ty, I saw that my sitemap.xml had some big holes in it.

Do you think this would be interesting to change the html-config.js like this

const isProduction = process.env.ELEVENTY_ENV === 'production';
export const htmlConfig = eleventyConfig => {
eleventyConfig.addTransform('html-minify', (content, path) => {
if (path && path.endsWith('.html') && isProduction) {

To something like this :

const isProduction = process.env.ELEVENTY_ENV === 'production';

const extensions = ['.html', '.xml']

export const htmlConfig = eleventyConfig => {
  eleventyConfig.addTransform('html-minify', (content, path) => {
    if (path && extensions.some(ext => path.endsWith(ext)) && isProduction) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions