Skip to content

Commit 5600917

Browse files
committed
feat: only add scripts when compiled for production
1 parent b4b80f4 commit 5600917

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Composables are meant to be placed into your layout components, as you usually w
2727
All composables accept an id/key, either as a plain string or as a ref.
2828
When using a ref, the script won't be added when its value is an empty string, undefined or any falsy value.
2929

30+
**Scripts won't be added at all when compiling the app in development mode (eg. when running `quasar dev`)**
31+
3032
```ts
3133
// src/layouts/main-layout.vue
3234

src/shared.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export function useTrackingMeta(
88
maybeId: TrackingId,
99
metaOptionsFn: (id: string) => MetaOptions
1010
): void {
11+
if (process.env.NODE_ENV === "development") {
12+
return;
13+
}
14+
1115
useMeta(() => {
1216
const id = unref(maybeId);
1317
if (!id) {

0 commit comments

Comments
 (0)