harlan-zw/nuxt-schema-org

`<script>` tag is not minified

Barbapapazes opened this issue · 1 comments

Describe the bug

Hello,

The generated content is not minified so it produces a larger build than needed.

To view it, open the reproduction, generate the project npm run generate and display the index.html using cat .output/public/index.html.

⬇️ not minified

<!DOCTYPE html>
<html >
<head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preload" as="fetch" crossorigin="anonymous" href="/_payload.json">
<link rel="modulepreload" as="script" crossorigin="" href="/_nuxt/entry.673ef46d.js">
<link rel="prefetch" as="script" crossorigin="" href="/_nuxt/error-404.682c2e35.js">
<link rel="prefetch" as="script" crossorigin="" href="/_nuxt/error-500.0dd9aeaa.js">
<script type="module" src="/_nuxt/entry.673ef46d.js" crossorigin=""></script></head>
<body ><div id="__nuxt"><!--[--><!----><!----><div>hello nuxt!</div><!--]--></div><script type="application/json" id="__NUXT_DATA__" data-ssr="true" data-src="/_payload.json">[{"state":1,"_errors":3,"serverRendered":5,"path":6,"prerenderedAt":7},["Reactive",2],{},["Reactive",4],{},true,"/",1693405373567]</script>
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script>
<script type="application/ld+json" id="schema-org-graph" data-hid="3437552">{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "#website",
      "@type": "WebSite",
      "name": "My Awesome Website"
    },
    {
      "@id": "#webpage",
      "@type": "WebPage",
      "isPartOf": {
        "@id": "#website"
      },
      "potentialAction": [
        {
          "@type": "ReadAction",
          "target": [
            null
          ]
        }
      ]
    }
  ]
}</script></body>
</html>

Reproduction

https://stackblitz.com/edit/github-bb3m3n

System / Nuxt Info

------------------------------
- Operating System: Linux
- Node Version:     v16.20.0
- Nuxt Version:     3.7.0
- CLI Version:      3.7.2
- Nitro Version:    2.6.2
- Package Manager:  npm@9.4.2
- Builder:          -
- User Config:      modules, devtools
- Runtime Modules:  nuxt-schema-org@2.2.0
- Build Modules:    -
------------------------------

Thanks! This will be available in v3 that will be released soon.