1

I'm working on a project with Wagtail CMS (headless) as backend and Nuxt 3 as frontend.

Steps to reproduce: Right click on the page (local development and/or live), and click on "View Page Source".

The content of the whole tag is on one line. I would like to prevent that, so that the page source has a normal HTML structure (e.g. like GitHub).

I tried the following in my nuxt.config.ts file:

build: {
    html: {
        minify: {
            collapseBooleanAttributes: false,
            decodeEntities: false,
            minifyCSS: false,
            minifyJS: false,
            processConditionalComments: false,
            removeEmptyAttributes: false,
            removeRedundantAttributes: false,
            trimCustomFragments: false,
            useShortDoctype: false,
        },
    },
},

But the page source is still on one line.

kissu
  • 40,416
  • 14
  • 65
  • 133
  • 1
    Why would you want to do it that way? Your code is bundle for production to allow better performance, isn't that one a thing that you don't care? You already have the exact code written down in git, why do you need it on your website in favor of precious seconds towards your visitors? – kissu Dec 05 '22 at 10:46
  • Well it's not me, it's the client who asked for that. I'm aware of the performance drop and the client is also. He only wants to have page source code not on one line. Any suggestions? – kirillwolkow Dec 06 '22 at 09:44
  • Hello, I'm the client in question. Go ahead and flame me... – theremin Dec 20 '22 at 15:16
  • @theremin hi there! You're quite welcome to expand on this decision (you have 600 characters). I would be quite curious about such a thing since nowadays, everybody is trying to get websites to perform better and faster. – kissu Dec 20 '22 at 15:18

0 Answers0