@nuxt/scripts 0.11.1 → 0.11.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.
- package/README.md +71 -71
- package/dist/client/200.html +9 -9
- package/dist/client/404.html +9 -9
- package/dist/client/_nuxt/{CtQNcfGE.js → Bo1SWr6k.js} +1 -1
- package/dist/client/_nuxt/BojlM8av.js +21 -0
- package/dist/client/_nuxt/{BFM-Ncmx.js → BwFnCI0m.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/4c86029b-49d8-417d-817c-09c5117d4d78.json +1 -0
- package/dist/client/_nuxt/{entry.ipQkUTQD.css → entry.CJckMUzn.css} +1 -1
- package/dist/client/_nuxt/error-404.BiTeRF3j.css +1 -0
- package/dist/client/_nuxt/error-500.Be1AE5oK.css +1 -0
- package/dist/client/_nuxt/{BSA2bgdb.js → yRslIvSb.js} +1 -1
- package/dist/client/index.html +9 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -19
- package/dist/registry.d.mts +3 -2
- package/dist/registry.d.ts +3 -2
- package/dist/registry.mjs +37 -26
- package/dist/runtime/components/ScriptAriaLoadingIndicator.vue +5 -5
- package/dist/runtime/components/ScriptCarbonAds.vue +83 -83
- package/dist/runtime/components/ScriptCrisp.vue +94 -94
- package/dist/runtime/components/ScriptGoogleAdsense.vue +93 -93
- package/dist/runtime/components/ScriptGoogleMaps.vue +495 -469
- package/dist/runtime/components/ScriptIntercom.vue +103 -103
- package/dist/runtime/components/ScriptLemonSqueezy.vue +52 -52
- package/dist/runtime/components/ScriptLoadingIndicator.vue +22 -22
- package/dist/runtime/components/ScriptStripePricingTable.vue +74 -74
- package/dist/runtime/components/ScriptVimeoPlayer.vue +288 -289
- package/dist/runtime/components/ScriptYouTubePlayer.vue +215 -215
- package/dist/runtime/composables/useScript.js +6 -3
- package/dist/runtime/composables/useScriptEventPage.js +1 -2
- package/dist/runtime/registry/clarity.d.ts +1 -1
- package/dist/runtime/registry/cloudflare-web-analytics.d.ts +1 -1
- package/dist/runtime/registry/google-adsense.js +1 -1
- package/dist/runtime/registry/google-analytics.d.ts +57 -13
- package/dist/runtime/registry/google-analytics.js +30 -28
- package/dist/runtime/registry/google-maps.d.ts +1 -1
- package/dist/runtime/registry/google-maps.js +4 -2
- package/dist/runtime/registry/google-tag-manager.d.ts +83 -21
- package/dist/runtime/registry/google-tag-manager.js +65 -24
- package/dist/runtime/types.d.ts +3 -10
- package/dist/runtime/utils.d.ts +1 -1
- package/package.json +20 -20
- package/dist/client/_nuxt/DuCkB5R-.js +0 -21
- package/dist/client/_nuxt/builds/meta/6161796c-413c-4c03-ac47-cad81a701b23.json +0 -1
- package/dist/client/_nuxt/error-404.BdjopNsg.css +0 -1
- package/dist/client/_nuxt/error-500.Bd7Z7Q7I.css +0 -1
package/README.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
[](https://scripts.nuxt.com)
|
|
2
|
-
|
|
3
|
-
[![npm version][npm-version-src]][npm-href]
|
|
4
|
-
[![npm downloads][npm-downloads-src]][npm-href]
|
|
5
|
-
[![License][license-src]][license-href]
|
|
6
|
-
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
-
[![Volta][volta-src]][volta-href]
|
|
8
|
-
|
|
9
|
-
# Nuxt Scripts
|
|
10
|
-
|
|
11
|
-
Better Privacy, Performance, and DX for Third-Party Scripts in Nuxt Apps.
|
|
12
|
-
|
|
13
|
-
- [👾 Playground](https://stackblitz.com/edit/nuxt-starter-pkwfkx?file=pages%2Findex.vue)
|
|
14
|
-
|
|
15
|
-
> [!IMPORTANT]
|
|
16
|
-
> Nuxt Scripts is in beta, use with caution as some APIs may change.
|
|
17
|
-
|
|
18
|
-
## Features
|
|
19
|
-
|
|
20
|
-
- 🪨 Built on top of [Unhead](https://unhead.unjs.io/usage/composables/use-script)
|
|
21
|
-
- 🎁 20+ third-party scripts integrations with fine-grained performance optimizations
|
|
22
|
-
- 🏎️ Performance: Self hosting, advanced script loading triggers, best-practice defaults.
|
|
23
|
-
- 🕵️ Privacy: Defaults to protect end users identity, script consent management APIs.
|
|
24
|
-
- 🪵 DevTools: View your script with their status and see function logs
|
|
25
|
-
- 🚀 0 dependencies, ~2kb minimal runtime
|
|
26
|
-
|
|
27
|
-
## Background
|
|
28
|
-
|
|
29
|
-
Loading third-party IIFE scripts using `useHead` composable is easy. However,
|
|
30
|
-
things start getting more complicated quickly around SSR, lazy loading, and type safety.
|
|
31
|
-
|
|
32
|
-
Nuxt Scripts was created to solve these issues and more with the goal of making third-party scripts more performant,
|
|
33
|
-
have better privacy and be better DX overall.
|
|
34
|
-
|
|
35
|
-
## 🚀 Quick Start
|
|
36
|
-
|
|
37
|
-
To get started, simply run:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npx nuxi@latest module add scripts
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
That's it! The Nuxt Scripts module should be downloaded and added to your Nuxt Config `modules`.
|
|
44
|
-
|
|
45
|
-
## ⛰️ Next Steps
|
|
46
|
-
|
|
47
|
-
Need some inspiration to start using Nuxt Scripts? Try out the following:
|
|
48
|
-
|
|
49
|
-
1. 🎉 Make it rain emojis with the [Confetti Tutorial](https://scripts.nuxt.com/docs/getting-started/confetti-tutorial).
|
|
50
|
-
2. 📚 Learn about how the [Script Loading](https://scripts.nuxt.com/docs/guides/script-triggers) works.
|
|
51
|
-
3. 🔍 Explore the [Script Registry](https://scripts.nuxt.com/scripts) for popular pre-configured third-party scripts.
|
|
52
|
-
3. 🚀 Load other scripts with [useScript](https://scripts.nuxt.com/docs/api/use-script) or [Global Scripts](https://scripts.nuxt.com/docs/guides/global).
|
|
53
|
-
4. 🔨 Fine-tune your performance and privacy with [Bundling](https://scripts.nuxt.com/docs/guides/bundling) and [Consent Management](https://scripts.nuxt.com/docs/guides/consent).
|
|
54
|
-
|
|
55
|
-
## ⚖️ License
|
|
56
|
-
|
|
57
|
-
Licensed under the [MIT license](https://github.com/nuxt/scripts/blob/main/LICENSE.md).
|
|
58
|
-
|
|
59
|
-
<!-- Badges -->
|
|
60
|
-
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/scripts/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
61
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxt/scripts.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
62
|
-
[npm-href]: https://npmjs.com/package/@nuxt/scripts
|
|
63
|
-
|
|
64
|
-
[license-src]: https://img.shields.io/npm/l/@nuxt/scripts.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
65
|
-
[license-href]: https://github.com/nuxt/scripts/blob/main/LICENSE.md
|
|
66
|
-
|
|
67
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
68
|
-
[nuxt-href]: https://nuxt.com
|
|
69
|
-
|
|
70
|
-
[volta-src]: https://user-images.githubusercontent.com/904724/209143798-32345f6c-3cf8-4e06-9659-f4ace4a6acde.svg
|
|
71
|
-
[volta-href]: https://volta.net/nuxt/scripts?utm_source=nuxt_scripts_readme
|
|
1
|
+
[](https://scripts.nuxt.com)
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
+
[![Volta][volta-src]][volta-href]
|
|
8
|
+
|
|
9
|
+
# Nuxt Scripts
|
|
10
|
+
|
|
11
|
+
Better Privacy, Performance, and DX for Third-Party Scripts in Nuxt Apps.
|
|
12
|
+
|
|
13
|
+
- [👾 Playground](https://stackblitz.com/edit/nuxt-starter-pkwfkx?file=pages%2Findex.vue)
|
|
14
|
+
|
|
15
|
+
> [!IMPORTANT]
|
|
16
|
+
> Nuxt Scripts is in beta, use with caution as some APIs may change.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- 🪨 Built on top of [Unhead](https://unhead.unjs.io/usage/composables/use-script)
|
|
21
|
+
- 🎁 20+ third-party scripts integrations with fine-grained performance optimizations
|
|
22
|
+
- 🏎️ Performance: Self hosting, advanced script loading triggers, best-practice defaults.
|
|
23
|
+
- 🕵️ Privacy: Defaults to protect end users identity, script consent management APIs.
|
|
24
|
+
- 🪵 DevTools: View your script with their status and see function logs
|
|
25
|
+
- 🚀 0 dependencies, ~2kb minimal runtime
|
|
26
|
+
|
|
27
|
+
## Background
|
|
28
|
+
|
|
29
|
+
Loading third-party IIFE scripts using `useHead` composable is easy. However,
|
|
30
|
+
things start getting more complicated quickly around SSR, lazy loading, and type safety.
|
|
31
|
+
|
|
32
|
+
Nuxt Scripts was created to solve these issues and more with the goal of making third-party scripts more performant,
|
|
33
|
+
have better privacy and be better DX overall.
|
|
34
|
+
|
|
35
|
+
## 🚀 Quick Start
|
|
36
|
+
|
|
37
|
+
To get started, simply run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx nuxi@latest module add scripts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
That's it! The Nuxt Scripts module should be downloaded and added to your Nuxt Config `modules`.
|
|
44
|
+
|
|
45
|
+
## ⛰️ Next Steps
|
|
46
|
+
|
|
47
|
+
Need some inspiration to start using Nuxt Scripts? Try out the following:
|
|
48
|
+
|
|
49
|
+
1. 🎉 Make it rain emojis with the [Confetti Tutorial](https://scripts.nuxt.com/docs/getting-started/confetti-tutorial).
|
|
50
|
+
2. 📚 Learn about how the [Script Loading](https://scripts.nuxt.com/docs/guides/script-triggers) works.
|
|
51
|
+
3. 🔍 Explore the [Script Registry](https://scripts.nuxt.com/scripts) for popular pre-configured third-party scripts.
|
|
52
|
+
3. 🚀 Load other scripts with [useScript](https://scripts.nuxt.com/docs/api/use-script) or [Global Scripts](https://scripts.nuxt.com/docs/guides/global).
|
|
53
|
+
4. 🔨 Fine-tune your performance and privacy with [Bundling](https://scripts.nuxt.com/docs/guides/bundling) and [Consent Management](https://scripts.nuxt.com/docs/guides/consent).
|
|
54
|
+
|
|
55
|
+
## ⚖️ License
|
|
56
|
+
|
|
57
|
+
Licensed under the [MIT license](https://github.com/nuxt/scripts/blob/main/LICENSE.md).
|
|
58
|
+
|
|
59
|
+
<!-- Badges -->
|
|
60
|
+
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/scripts/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
61
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxt/scripts.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
62
|
+
[npm-href]: https://npmjs.com/package/@nuxt/scripts
|
|
63
|
+
|
|
64
|
+
[license-src]: https://img.shields.io/npm/l/@nuxt/scripts.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
65
|
+
[license-href]: https://github.com/nuxt/scripts/blob/main/LICENSE.md
|
|
66
|
+
|
|
67
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
68
|
+
[nuxt-href]: https://nuxt.com
|
|
69
|
+
|
|
70
|
+
[volta-src]: https://user-images.githubusercontent.com/904724/209143798-32345f6c-3cf8-4e06-9659-f4ace4a6acde.svg
|
|
71
|
+
[volta-href]: https://volta.net/nuxt/scripts?utm_source=nuxt_scripts_readme
|
package/dist/client/200.html
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
5
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.
|
|
6
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
10
|
-
<script type="module" src="/__nuxt-scripts/_nuxt/
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CJckMUzn.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BojlM8av.js">
|
|
5
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BiTeRF3j.css">
|
|
6
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/yRslIvSb.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Bo1SWr6k.js">
|
|
8
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.Be1AE5oK.css">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BwFnCI0m.js">
|
|
10
|
+
<script type="module" src="/__nuxt-scripts/_nuxt/BojlM8av.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__">[{"prerenderedAt":1,"serverRendered":2},1742932487543,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"4c86029b-49d8-417d-817c-09c5117d4d78",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
5
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.
|
|
6
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
10
|
-
<script type="module" src="/__nuxt-scripts/_nuxt/
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CJckMUzn.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BojlM8av.js">
|
|
5
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BiTeRF3j.css">
|
|
6
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/yRslIvSb.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Bo1SWr6k.js">
|
|
8
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.Be1AE5oK.css">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BwFnCI0m.js">
|
|
10
|
+
<script type="module" src="/__nuxt-scripts/_nuxt/BojlM8av.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__">[{"prerenderedAt":1,"serverRendered":2},1742932487543,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"4c86029b-49d8-417d-817c-09c5117d4d78",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,f as s,h as r,i as o,g as i}from"./
|
|
1
|
+
import{u as a,f as s,h as r,i as o,g as i}from"./BojlM8av.js";function u(n){var t;const e=n||s();return((t=e==null?void 0:e.ssrContext)==null?void 0:t.head)||(e==null?void 0:e.runWithContext(()=>{if(r())return o(i)}))}function d(n,e={}){const t=u(e.nuxt);if(t)return a(n,{head:t,...e})}export{d as u};
|