@unhead/bundler 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"62c3cddd-5b29-4c74-aa49-0d1cf767b786",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775801220437,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"3798f24f-addb-49fd-9061-3568d6b590e9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775970624091,false]</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"62c3cddd-5b29-4c74-aa49-0d1cf767b786",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775801220437,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"3798f24f-addb-49fd-9061-3568d6b590e9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775970624091,false]</script></body></html>
@@ -1 +1 @@
1
- {"id":"62c3cddd-5b29-4c74-aa49-0d1cf767b786","timestamp":1775801211120}
1
+ {"id":"3798f24f-addb-49fd-9061-3568d6b590e9","timestamp":1775970614983}
@@ -0,0 +1 @@
1
+ {"id":"3798f24f-addb-49fd-9061-3568d6b590e9","timestamp":1775970614983,"prerendered":[]}
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"62c3cddd-5b29-4c74-aa49-0d1cf767b786",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775801220438,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"3798f24f-addb-49fd-9061-3568d6b590e9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775970624091,false]</script></body></html>
@@ -148,10 +148,13 @@ const HEAD_SSR_RE = /\bhead\.ssr\b/g;
148
148
  const JS_RE = /\.(?:c|m)?js$/;
149
149
  const SSRStaticReplace = createUnplugin(() => {
150
150
  let ssr = false;
151
+ let enabled = true;
151
152
  return {
152
153
  name: "unhead:ssr-static-replace",
153
154
  enforce: "pre",
154
155
  transformInclude(id) {
156
+ if (!enabled)
157
+ return false;
155
158
  if (!UNHEAD_MODULE_RE.test(id))
156
159
  return false;
157
160
  return JS_RE.test(id);
@@ -176,6 +179,10 @@ const SSRStaticReplace = createUnplugin(() => {
176
179
  },
177
180
  vite: {
178
181
  apply(_config, env) {
182
+ if (env.command === "serve") {
183
+ enabled = false;
184
+ return true;
185
+ }
179
186
  if (env.isSsrBuild)
180
187
  ssr = true;
181
188
  return true;
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
  import MagicString from 'magic-string';
5
5
  import { parseAndWalk } from 'oxc-walker';
6
6
  import { defineRpcFunction } from '@vitejs/devtools-kit';
7
- import { T as TreeshakeServerComposables, U as UseSeoMetaTransform, M as MinifyTransform, S as SSRStaticReplace } from './shared/bundler.DRWfqG8C.mjs';
7
+ import { T as TreeshakeServerComposables, U as UseSeoMetaTransform, M as MinifyTransform, S as SSRStaticReplace } from './shared/bundler.BgFGu6g_.mjs';
8
8
  import 'oxc-parser';
9
9
  import 'ufo';
10
10
  import 'unplugin';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { T as TreeshakeServerComposables, U as UseSeoMetaTransform, M as MinifyTransform, S as SSRStaticReplace } from './shared/bundler.DRWfqG8C.mjs';
1
+ import { T as TreeshakeServerComposables, U as UseSeoMetaTransform, M as MinifyTransform, S as SSRStaticReplace } from './shared/bundler.BgFGu6g_.mjs';
2
2
  import 'node:url';
3
3
  import 'magic-string';
4
4
  import 'oxc-parser';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/bundler",
3
3
  "type": "module",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "description": "Unhead build-time optimizations for Vite and Webpack.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -76,7 +76,7 @@
76
76
  "esbuild": ">=0.17.0",
77
77
  "lightningcss": ">=1.20.0",
78
78
  "rolldown": ">=1.0.0-beta.0",
79
- "unhead": "^3.0.2"
79
+ "unhead": "^3.0.3"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "esbuild": {
@@ -100,7 +100,7 @@
100
100
  "devDependencies": {
101
101
  "rollup": "^4.60.1",
102
102
  "vite": "^8.0.8",
103
- "unhead": "3.0.2"
103
+ "unhead": "3.0.3"
104
104
  },
105
105
  "scripts": {
106
106
  "build": "unbuild",
@@ -1 +0,0 @@
1
- {"id":"62c3cddd-5b29-4c74-aa49-0d1cf767b786","timestamp":1775801211120,"prerendered":[]}