@nuxt/scripts 1.0.0-beta.17 → 1.0.0-beta.18
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/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/e9af4ec4-4502-4171-9264-54123d0ae2ea.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +53 -1
- package/dist/runtime/registry/plausible-analytics.js +5 -6
- package/dist/runtime/types.d.ts +1 -1
- package/package.json +2 -2
- package/dist/client/_nuxt/builds/meta/54747b43-880a-49d1-91ff-d00dbcdf3ad7.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -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="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"e9af4ec4-4502-4171-9264-54123d0ae2ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1772773570478,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -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="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"e9af4ec4-4502-4171-9264-54123d0ae2ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1772773570479,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"e9af4ec4-4502-4171-9264-54123d0ae2ea","timestamp":1772773565943}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"e9af4ec4-4502-4171-9264-54123d0ae2ea","timestamp":1772773565943,"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -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="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D45OuV0w.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/NbccNBFl.js"><script type="module" src="/__nuxt-scripts/_nuxt/NbccNBFl.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:""}},app:{baseURL:"/__nuxt-scripts",buildId:"e9af4ec4-4502-4171-9264-54123d0ae2ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1772773570480,false]</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -946,6 +946,35 @@ function fixSelfClosingScriptComponents(nuxt) {
|
|
|
946
946
|
});
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
+
const REGISTRY_ENV_DEFAULTS = {
|
|
950
|
+
clarity: { id: "" },
|
|
951
|
+
cloudflareWebAnalytics: { token: "" },
|
|
952
|
+
crisp: { id: "" },
|
|
953
|
+
databuddyAnalytics: { clientId: "" },
|
|
954
|
+
fathomAnalytics: { site: "" },
|
|
955
|
+
googleAdsense: { client: "" },
|
|
956
|
+
googleAnalytics: { id: "" },
|
|
957
|
+
googleMaps: { apiKey: "" },
|
|
958
|
+
googleRecaptcha: { siteKey: "" },
|
|
959
|
+
googleSignIn: { clientId: "" },
|
|
960
|
+
googleTagManager: { id: "" },
|
|
961
|
+
hotjar: { id: "" },
|
|
962
|
+
intercom: { app_id: "" },
|
|
963
|
+
matomoAnalytics: { matomoUrl: "" },
|
|
964
|
+
metaPixel: { id: "" },
|
|
965
|
+
paypal: { clientId: "" },
|
|
966
|
+
plausibleAnalytics: { domain: "" },
|
|
967
|
+
posthog: { apiKey: "" },
|
|
968
|
+
redditPixel: { id: "" },
|
|
969
|
+
rybbitAnalytics: { siteId: "" },
|
|
970
|
+
segment: { writeKey: "" },
|
|
971
|
+
snapchatPixel: { id: "" },
|
|
972
|
+
stripe: {},
|
|
973
|
+
tiktokPixel: { id: "" },
|
|
974
|
+
umamiAnalytics: { websiteId: "" },
|
|
975
|
+
vercelAnalytics: {},
|
|
976
|
+
xPixel: { id: "" }
|
|
977
|
+
};
|
|
949
978
|
const PARTYTOWN_FORWARDS = {
|
|
950
979
|
googleAnalytics: ["dataLayer.push", "gtag"],
|
|
951
980
|
plausible: ["plausible"],
|
|
@@ -1020,9 +1049,26 @@ const module$1 = defineNuxtModule({
|
|
|
1020
1049
|
};
|
|
1021
1050
|
if (config.registry) {
|
|
1022
1051
|
nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {};
|
|
1052
|
+
const registryWithDefaults = {};
|
|
1053
|
+
for (const [key, value] of Object.entries(config.registry)) {
|
|
1054
|
+
if (value && REGISTRY_ENV_DEFAULTS[key]) {
|
|
1055
|
+
const envDefaults = REGISTRY_ENV_DEFAULTS[key];
|
|
1056
|
+
if (value === true || value === "mock") {
|
|
1057
|
+
registryWithDefaults[key] = { ...envDefaults };
|
|
1058
|
+
} else if (typeof value === "object" && !Array.isArray(value)) {
|
|
1059
|
+
registryWithDefaults[key] = defu(value, envDefaults);
|
|
1060
|
+
} else if (Array.isArray(value)) {
|
|
1061
|
+
registryWithDefaults[key] = defu(value[0] || {}, envDefaults);
|
|
1062
|
+
} else {
|
|
1063
|
+
registryWithDefaults[key] = value;
|
|
1064
|
+
}
|
|
1065
|
+
} else {
|
|
1066
|
+
registryWithDefaults[key] = value;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1023
1069
|
nuxt.options.runtimeConfig.public.scripts = defu(
|
|
1024
1070
|
nuxt.options.runtimeConfig.public.scripts || {},
|
|
1025
|
-
|
|
1071
|
+
registryWithDefaults
|
|
1026
1072
|
);
|
|
1027
1073
|
}
|
|
1028
1074
|
if (config.defaultScriptOptions?.bundle !== void 0) {
|
|
@@ -1198,6 +1244,12 @@ const module$1 = defineNuxtModule({
|
|
|
1198
1244
|
phConfig.apiHost = region === "eu" ? `${firstPartyCollectPrefix}/ph-eu` : `${firstPartyCollectPrefix}/ph`;
|
|
1199
1245
|
}
|
|
1200
1246
|
}
|
|
1247
|
+
if (config.registry?.plausibleAnalytics && typeof config.registry.plausibleAnalytics === "object") {
|
|
1248
|
+
const paConfig = Array.isArray(config.registry.plausibleAnalytics) ? config.registry.plausibleAnalytics[0] : config.registry.plausibleAnalytics;
|
|
1249
|
+
if (paConfig && !paConfig.endpoint) {
|
|
1250
|
+
paConfig.endpoint = `${firstPartyCollectPrefix}/plausible/api/event`;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1201
1253
|
if (unsupportedScripts.length && nuxt.options.dev) {
|
|
1202
1254
|
logger.warn(
|
|
1203
1255
|
`First-party mode is enabled but these scripts don't support it yet: ${unsupportedScripts.join(", ")}.
|
|
@@ -67,12 +67,11 @@ export function useScriptPlausibleAnalytics(_options) {
|
|
|
67
67
|
initOptions.autoCapturePageviews = options.autoCapturePageviews;
|
|
68
68
|
if (options?.captureOnLocalhost !== void 0)
|
|
69
69
|
initOptions.captureOnLocalhost = options.captureOnLocalhost;
|
|
70
|
-
const scriptInput =
|
|
71
|
-
|
|
72
|
-
"data-domain"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
70
|
+
const scriptInput = { src: scriptSrc };
|
|
71
|
+
if (!useNewScript && options?.domain)
|
|
72
|
+
scriptInput["data-domain"] = options.domain;
|
|
73
|
+
if (!useNewScript && options?.endpoint)
|
|
74
|
+
scriptInput["data-api"] = options.endpoint;
|
|
76
75
|
return {
|
|
77
76
|
scriptInput,
|
|
78
77
|
schema: import.meta.dev ? PlausibleAnalyticsOptionsSchema : void 0,
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -191,7 +191,7 @@ export interface ScriptRegistry {
|
|
|
191
191
|
export type NuxtConfigScriptRegistryEntry<T> = true | 'mock' | T | [T, NuxtUseScriptOptionsSerializable];
|
|
192
192
|
export type NuxtConfigScriptRegistry<T extends keyof ScriptRegistry = keyof ScriptRegistry> = Partial<{
|
|
193
193
|
[key in T]: NuxtConfigScriptRegistryEntry<ScriptRegistry[key]>;
|
|
194
|
-
}
|
|
194
|
+
}> & Record<string & {}, NuxtConfigScriptRegistryEntry<any>>;
|
|
195
195
|
export type UseFunctionType<T, U> = T extends {
|
|
196
196
|
use: infer V;
|
|
197
197
|
} ? V extends (...args: any) => any ? ReturnType<V> : U : U;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.18",
|
|
5
5
|
"description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"vue": "^3.5.29",
|
|
142
142
|
"vue-router": "^5.0.3",
|
|
143
143
|
"vue-tsc": "^3.2.5",
|
|
144
|
-
"@nuxt/scripts": "1.0.0-beta.
|
|
144
|
+
"@nuxt/scripts": "1.0.0-beta.18"
|
|
145
145
|
},
|
|
146
146
|
"resolutions": {
|
|
147
147
|
"@nuxt/scripts": "workspace:*"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"54747b43-880a-49d1-91ff-d00dbcdf3ad7","timestamp":1772765383758,"prerendered":[]}
|