@nuxt/scripts 0.8.0 → 0.8.1

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,7 +1,7 @@
1
1
  <!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
3
  <link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.BAZUAl3s.css">
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BYm2jJpo.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/g9Cc3Sbs.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
6
6
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BigF1UXR.js">
7
7
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
@@ -257,10 +257,10 @@
257
257
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B3g-KkBK.js">
258
258
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Bxkoe-BC.js">
259
259
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Br6ll-O0.js">
260
- <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.ChzstOPh.css">
261
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B7a7KwY0.js">
262
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CEoS15Fi.js">
263
- <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.BaOmLlKq.css">
264
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Nd9uLa0s.js">
265
- <script type="module" src="/__nuxt-scripts/_nuxt/BYm2jJpo.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
266
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"ec7cd9b1-e776-4993-98a3-da039c5325b9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
260
+ <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.JSbzC_WU.css">
261
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C-wUfrx2.js">
262
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DZ7-g9rx.js">
263
+ <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.DRrtE75f.css">
264
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CcDMurmi.js">
265
+ <script type="module" src="/__nuxt-scripts/_nuxt/g9Cc3Sbs.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
266
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"6e8bc2d6-d4a3-4713-b646-7851973e4d6c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.8.0",
8
+ "version": "0.8.1",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.3",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -185,7 +185,7 @@ function NuxtScriptBundleTransformer(options) {
185
185
  if (canBundle) {
186
186
  const newSrc = options.resolveScript(src);
187
187
  if (src === newSrc) {
188
- if (src.startsWith("/"))
188
+ if (src && src.startsWith("/"))
189
189
  console.warn(`[Nuxt Scripts: Bundle Transformer] Relative scripts are already bundled. Skipping bundling for \`${src}\`.`);
190
190
  else
191
191
  console.warn(`[Nuxt Scripts: Bundle Transformer] Failed to bundle ${src}.`);
@@ -9,15 +9,16 @@ export function useScript(input, options) {
9
9
  input = typeof input === "string" ? { src: input } : input;
10
10
  options = defu(options, useNuxtScriptRuntimeConfig()?.defaultScriptOptions);
11
11
  const rel = options.trigger === "onNuxtReady" ? "preload" : "preconnect";
12
+ const isCrossOrigin = input.src && !input.src.startsWith("/");
12
13
  const id = resolveScriptKey(input);
13
- if (options.trigger !== "server" && (rel === "preload" || !input.src.startsWith("/"))) {
14
+ if (input.src && options.trigger !== "server" && (rel === "preload" || isCrossOrigin)) {
14
15
  useHead({
15
16
  link: [
16
17
  {
17
18
  rel,
18
19
  as: rel === "preload" ? "script" : void 0,
19
20
  href: input.src,
20
- crossorigin: input.src.startsWith("/") ? void 0 : typeof input.crossorigin !== "undefined" ? input.crossorigin : "anonymous",
21
+ crossorigin: isCrossOrigin ? void 0 : typeof input.crossorigin !== "undefined" ? input.crossorigin : "anonymous",
21
22
  key: `nuxt-script-${id}`,
22
23
  tagPriority: rel === "preload" ? "high" : 0,
23
24
  fetchpriority: "low"
@@ -2,4 +2,7 @@ import type { TrackedPage } from '#nuxt-scripts';
2
2
  export declare function useScriptEventPage(onChange?: (payload: TrackedPage) => void): import("vue").Ref<{
3
3
  title?: string | undefined;
4
4
  path: string;
5
+ }, TrackedPage | {
6
+ title?: string | undefined;
7
+ path: string;
5
8
  }>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
5
5
  "packageManager": "pnpm@9.9.0",
6
6
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
7
7
  "author": {
@@ -72,7 +72,7 @@
72
72
  "@types/stripe-v3": "^3.1.33",
73
73
  "@types/vimeo__player": "^2.18.3",
74
74
  "@types/youtube": "^0.1.0",
75
- "@unhead/vue": "^1.10.3",
75
+ "@unhead/vue": "^1.10.4",
76
76
  "@vueuse/core": "^11.0.3",
77
77
  "consola": "^3.2.3",
78
78
  "defu": "^6.1.4",
@@ -101,7 +101,7 @@
101
101
  "@nuxt/test-utils": "3.14.1",
102
102
  "@types/semver": "^7.5.8",
103
103
  "@typescript-eslint/typescript-estree": "^8.4.0",
104
- "@unhead/schema": "^1.10.3",
104
+ "@unhead/schema": "^1.10.4",
105
105
  "acorn-loose": "^8.4.0",
106
106
  "bumpp": "^9.5.2",
107
107
  "changelogen": "^0.5.5",
@@ -113,7 +113,7 @@
113
113
  "playwright-core": "^1.46.1",
114
114
  "typescript": "^5.5.4",
115
115
  "vitest": "^2.0.5",
116
- "vue": "^3.4.38",
116
+ "vue": "^3.5.0",
117
117
  "vue-router": "^4.4.3"
118
118
  },
119
119
  "resolutions": {
@@ -128,7 +128,7 @@
128
128
  "nuxt-scripts-devtools": "workspace:*",
129
129
  "shiki": "1.10.3",
130
130
  "unhead": "1.10.4",
131
- "vue": "^3.4.38",
131
+ "vue": "^3.5.0",
132
132
  "vue-router": "^4.4.3"
133
133
  }
134
134
  }
@@ -1 +0,0 @@
1
- import{_ as a,o as s,c as i,a as e,t as o,b as u,w as c,d,e as l,p,f}from"./BYm2jJpo.js";import{u as h}from"./CEoS15Fi.js";const b=t=>(p("data-v-32febeca"),t=t(),f(),t),g={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},x=b(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),m={class:"max-w-520px text-center z-20"},y=["textContent"],_=["textContent"],k={class:"w-full flex items-center justify-center"},w={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const n=t;return h({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(z,S)=>{const r=l;return s(),i("div",g,[x,e("div",m,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:o(t.statusCode)},null,8,y),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:o(t.description)},null,8,_),e("div",k,[u(r,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[d(o(t.backHome),1)]),_:1})])])])}}},N=a(w,[["__scopeId","data-v-32febeca"]]);export{N as default};