While using nuxt generate
, nuxt minifies the html as follows,
<!doctype html>
<html data-n-head-ssr lang="en" data-n-head="%7B%22lang%22:%7B%22ssr%22:%22en%22%7D%7D">
<head>
<title>Website</title><meta data-n-head="ssr" charset="utf-8"><meta data-n-head="ssr" name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta data-n-head="ssr" name="description" content="Website"><meta data-n-head="ssr" name="format-detection" content="telephone=no"><link data-n-head="ssr" rel="icon" type="image/x-icon" href="/favicon.ico">
As you can see the line breaks after <!doctype html>
, <html>
, <head>
aren’t removed. Why is that? And how do I remove the line breaks? Thanks.
nuxt.config.js
import path from "path"
export default {
target: "static",
// Target: https://go.nuxtjs.dev/config-target
// target: "static",
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: "Website",
htmlAttrs: {
lang: "en",
},
meta: [
{ charset: "utf-8" },
{
name: "viewport",
content: "width=device-width, initial-scale=1, shrink-to-fit=no",
},
{
name: "description",
content: "Website",
},
{ name: "format-detection", content: "telephone=no" },
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
router: {
trailingSlash: false,
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/content
"@nuxt/content",
],
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {},
// Build Configuration: https://go.nuxtjs.dev/config-build
alias: {
"@/": path.resolve(__dirname, "/"),
},
}